Documentation
¶
Index ¶
- Constants
- func CheckError(err error)
- func CheckErrorF(err error, format string, message ...any)
- func CheckErrorln(err error)
- func CheckFatal(err error)
- func CheckFatalF(err error, format string, message ...any)
- func CheckFatalln(err error)
- func Debug(message ...any)
- func DebugF(format string, message ...any)
- func Debugln(message ...any)
- func Error(message ...any)
- func ErrorF(format string, message ...any)
- func Errorln(message ...any)
- func Fatal(message ...any)
- func FatalF(format string, message ...any)
- func Fatalln(message ...any)
- func GetLogLevel() int
- func Info(message ...any)
- func InfoF(format string, message ...any)
- func Infoln(message ...any)
- func NewDefaultLogger() logger
- func NewLogger(level int, outputWriter io.Writer, errOutputWriter io.Writer) logger
- func SetErrorOutputWriter(writer io.Writer)
- func SetErrorPrefixFormatter(errorPrefixFormatter func(level int) string)
- func SetLogLevel(level int)
- func SetOutputWriter(writer io.Writer)
- func SetOutputWriters(writer io.Writer, errWriter io.Writer)
- func SetPrefixFormatter(prefixFormatter func(level int) string)
- func SetPrefixFormatters(prefixFormatter func(level int) string, ...)
- func Warning(message ...any)
- func WarningF(format string, message ...any)
- func Warningln(message ...any)
Constants ¶
const ( DEBUG = iota INFO WARNING ERROR FATAL OFF )
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
func CheckError(err error)
CheckError checks error and logs with ERROR level to error output if not nil
func CheckErrorF ¶
CheckErrorF checks error and logs formatted message with ERROR level to error output if not nil
func CheckErrorln ¶
func CheckErrorln(err error)
CheckErrorln checks error and logs with ERROR level to error output if not nil and a newline
func CheckFatal ¶
func CheckFatal(err error)
CheckFatal checks error and logs with FATAL level to error output and exits with 1 if not nil
func CheckFatalF ¶
CheckFatalF checks error and logs formatted message with FATAL level to error output and exits with 1 if not nil
func CheckFatalln ¶
func CheckFatalln(err error)
CheckFatalln checks error and logs with FATAL level to error output and exits with 1 if not nil and a newline
func Errorln ¶
func Errorln(message ...any)
Errorln logs with ERROR level to error output and a newline
func Fatal ¶
func Fatal(message ...any)
Fatal logs with FATAL level to error output and exits with 1
func Fatalln ¶
func Fatalln(message ...any)
Fatalln logs with FATAL level to error output and exits with 1 and a newline
func NewDefaultLogger ¶
func NewDefaultLogger() logger
NewDefaultLogger creates a new logger instance with default log level, standard output and error output
func NewLogger ¶
NewLogger creates a new logger instance with the specified log level, output writer and error output writer
func SetErrorOutputWriter ¶
SetErrorOutputWriter sets the output writer for error output
func SetErrorPrefixFormatter ¶ added in v1.1.0
SetErrorPrefixFormatter sets the prefix for the error log message
func SetOutputWriter ¶
SetOutputWriter sets the output writer for standard output
func SetOutputWriters ¶
SetOutputWriters sets the output writers for standard output and error output
func SetPrefixFormatter ¶ added in v1.1.0
SetPrefixFormatter sets the prefix formatter for the log message
func SetPrefixFormatters ¶ added in v1.1.0
func SetPrefixFormatters(prefixFormatter func(level int) string, errorPrefixFormatter func(level int) string)
SetPrefixFormatters sets the prefix formatters for the log message and the error log message
Types ¶
This section is empty.