Documentation
¶
Index ¶
- func Closer(c io.Closer)
- func Debug(v ...any)
- func Debugf(format string, v ...any)
- func DumpHttpRequest(r *http.Request, logLevel Level)
- func DumpHttpResponse(r *http.Response, logLevel Level)
- func Error(v ...any)
- func Errorf(format string, v ...any)
- func Fatal(v ...any)
- func Fatalf(format string, v ...any)
- func FunctionInfo(skip int) (name, file string, line int, ok bool)
- func InLevel(level Level) bool
- func Info(v ...any)
- func Infof(format string, v ...any)
- func SetAdditionalOut(out io.Writer)
- func SetFormat(f Format)
- func SetFuncNamePrinting(on bool)
- func SetLevel(level Level)
- func SetTimeFormat(format string)
- func Trace(v ...any)
- func Tracef(format string, v ...any)
- func Warn(v ...any)
- func Warnf(format string, v ...any)
- type Format
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Closer ¶
Closer calls the Close method, if the closure occurred with an error, it prints it to the log.
func DumpHttpRequest ¶
DumpHttpRequest dumps the HTTP request and prints out with logFunc.
func DumpHttpResponse ¶
DumpHttpResponse dumps the HTTP response and prints out with logFunc.
func FunctionInfo ¶
FunctionInfo returns the name of the function and file, the line number on the calling goroutine's stack. The argument skip is the number of stack frames to ascend.
func InLevel ¶
InLevel returns true if the given level is less than or equal to the current logger level.
func SetAdditionalOut ¶
SetAdditionalOut sets an additional logger output.
func SetFuncNamePrinting ¶
func SetFuncNamePrinting(on bool)
SetFuncNamePrinting sets whether the logger should print the caller function name.
Types ¶
type Format ¶
type Format uint8
func ParseFormat ¶
ParseFormat takes a string format and returns the logger Format constant.