Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextLogger ¶
type ContextLogger interface {
WithCtxFields(ctx context.Context) ContextLogger
SetCtxField(ctx context.Context, key string, value string) context.Context
IsEnabledFor(level Level) bool
Trace(args ...interface{})
Tracef(msg string, args ...interface{})
Debug(args ...interface{})
Debugf(msg string, args ...interface{})
Info(args ...interface{})
Infof(msg string, args ...interface{})
Warn(args ...interface{})
Warnf(msg string, args ...interface{})
Error(args ...interface{})
Errorf(msg string, args ...interface{})
// TODO: WithPanic
Panic(args ...interface{})
Panicf(msg string, args ...interface{})
Fatal(args ...interface{})
Fatalf(msg string, args ...interface{})
WithField(key string, value string) ContextLogger
WithError(err error) ContextLogger
SkipCallers(count int) ContextLogger
}
func GetLogger ¶
func GetLogger(module interface{}) ContextLogger
type Level ¶
type Level uint
const ( TraceLevel Level = iota // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel )
func Text2Level ¶
Click to show internal directories.
Click to hide internal directories.