Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(logger Logger)
Types ¶
type LogLevel ¶
type LogLevel string
LogLevel is Logger Level type
const ( // DebugLevel has verbose message DebugLevel LogLevel = "debug" // InfoLevel is default log level InfoLevel LogLevel = "info" // WarnLevel is for logging messages about possible issues WarnLevel LogLevel = "warn" // ErrorLevel is for logging errors ErrorLevel LogLevel = "error" // FatalLevel is for logging fatal messages. The system shuts down after logging the message. FatalLevel LogLevel = "fatal" )
type Logger ¶
type Logger interface { WithFields(map[string]any) Logger Debug(args ...any) Debugf(format string, args ...any) Info(args ...any) Infof(format string, args ...any) Warn(args ...any) Warnf(format string, args ...any) Error(args ...any) Errorf(format string, args ...any) Fatal(args ...any) Fatalf(format string, args ...any) GetLevel() LogLevel IsLevelEnabled(level LogLevel) bool }
func NewLogger ¶
func NewLogger(opts ...LoggerOption) Logger
type LoggerOption ¶
type LoggerOption func(opts *LoggerOptions)
func FormatLoggerOption ¶
func FormatLoggerOption(format LogFormat) LoggerOption
func LevelLoggerOption ¶
func LevelLoggerOption(level LogLevel) LoggerOption
func OutputLoggerOption ¶
func OutputLoggerOption(out io.Writer) LoggerOption
Click to show internal directories.
Click to hide internal directories.