Documentation ¶
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func SetDefaultLogger(l Logger)
- func SetLevel(lv Level)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Fields
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls the default logger's Debugf method.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls the default logger's Errorf method.
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls the default logger's Infof method.
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf calls the default logger's Fatalf method
func SetDefaultLogger ¶
func SetDefaultLogger(l Logger)
SetDefaultLogger sets the default logger. This is not concurrency safe, which means it should only be called during init.
Types ¶
type Level ¶
type Level int
Level defines the priority of a log message. When a logger is configured with a level, any log message with a lower log level (smaller by integer comparison) will not be output.
type Logger ¶
type Logger interface { Debug(v ...any) Info(v ...any) Warn(v ...any) Error(v ...any) Panic(v ...any) Debugf(format string, v ...any) Infof(format string, v ...any) Warnf(format string, v ...any) Errorf(format string, v ...any) Panicf(format string, v ...any) WithField(key string, value any) Logger WithFields(fields Fields) Logger WithError(err error) Logger }
Logger is a logger interface that provides logging function with levels.
func DefaultLogger ¶
func DefaultLogger() Logger
func WithFields ¶
WithFields calls the default logger's WithFields method.
Click to show internal directories.
Click to hide internal directories.