Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(msg string, args ...interface{})
- func Setup(f FactoryFunc, fls map[string]interface{}) error
- func Warn(args ...interface{})
- func Warnf(msg string, args ...interface{})
- func WithContext(ctx context.Context, l Logger) context.Context
- type FactoryFunc
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(f FactoryFunc, fls map[string]interface{}) error
Setup logging by providing a logger factory.
Types ¶
type FactoryFunc ¶ added in v0.4.6
FactoryFunc function type for creating loggers.
type Level ¶
type Level string
The Level type definition.
const ( // DebugLevel level. DebugLevel Level = "debug" // InfoLevel level. InfoLevel Level = "info" // WarnLevel level. WarnLevel Level = "warn" // ErrorLevel level. ErrorLevel Level = "error" // FatalLevel level. FatalLevel Level = "fatal" // PanicLevel level. PanicLevel Level = "panic" // NoLevel level. NoLevel Level = "" )
type Logger ¶
type Logger interface { Sub(map[string]interface{}) Logger Fatal(...interface{}) Fatalf(string, ...interface{}) Panic(...interface{}) Panicf(string, ...interface{}) Error(...interface{}) Errorf(string, ...interface{}) Warn(...interface{}) Warnf(string, ...interface{}) Info(...interface{}) Infof(string, ...interface{}) Debug(...interface{}) Debugf(string, ...interface{}) }
Logger interface definition of a logger.
func FromContext ¶ added in v0.11.0
FromContext returns the logger in the context or a nil logger.
Click to show internal directories.
Click to hide internal directories.