Documentation
¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Init(opts ...Option) error
- func Log(level Level, args ...interface{})
- func Logf(level Level, format string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func String() string
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Level
- type LogOption
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Level ¶
type Level uint32
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel )
type Logger ¶
type Logger interface { Init(opts ...Option) error Log(level Level, args ...interface{}) Logf(level Level, format string, args ...interface{}) Info(args ...interface{}) Debug(args ...interface{}) Warn(args ...interface{}) Trace(args ...interface{}) Error(args ...interface{}) Panic(args ...interface{}) Fatal(args ...interface{}) Errorf(format string, args ...interface{}) Tracef(format string, args ...interface{}) Warnf(format string, args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Panicf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) String() string }
var DefaultLogger Logger = newLogger(WithLevel(DebugLevel))
type Option ¶
type Option func(o *LogOption)
func WithFields ¶
WithFields set logger with custom fields
func WithOutput ¶
WithOutput set default default output for the logger
Click to show internal directories.
Click to hide internal directories.