Documentation ¶
Index ¶
- Variables
- func Close()
- func ConfigLogger(maxLevel string, colorize bool)
- func Debug(format string, a ...any)
- func DebugOnError(err error, format string, a ...any)
- func Error(format string, a ...any)
- func ErrorOnError(err error, format string, a ...any)
- func Info(format string, a ...any)
- func Notice(format string, a ...any)
- func NoticeOnError(err error, format string, a ...any)
- func SprintJSON(v any) string
- func WarnOnError(err error, format string, a ...any)
- func Warning(format string, a ...any)
- type Logger
Constants ¶
This section is empty.
Variables ¶
var Stamp = true
Functions ¶
func ConfigLogger ¶
ConfigLogger configures the global logger with the specified level. The level parameter can be one of "debug", "info", "notice", "error", or any other value for the default level.
func DebugOnError ¶
func Error ¶
Error prints an error message using the global logger.
Args:
format (string): The format string for the error message. a (any): The variadic arguments to be formatted into the message.
func ErrorOnError ¶
ErrorOnError appends the error to the variadic parameter a and logs a debug message if the error is not nil.
Parameters:
- err: the error to be appended to the variadic parameter a.
- format: the format string for the debug message.
- a: variadic parameter that holds additional arguments for the format string.
func Notice ¶
Notice prints a notice message using the global logger.
Args:
format (string): The format string for the notice message. a (any): The variadic arguments to be formatted into the message.
func NoticeOnError ¶
NoticeOnError appends the error to the variadic arguments and logs the formatted message if the error is not nil.
Parameters: - err: the error to check and append to the variadic arguments. - format: the format string for the log message. - a: variadic arguments for the format string.
func WarnOnError ¶
WarnOnError log warning on error