Documentation ¶
Index ¶
- func Build(service string, level log.Level, f log.Formatter, p log.Printer) log.Logger
- func New(service string, config config.Tree) (log.Logger, error)
- func StdOut(service string, level log.Level) (log.Logger, error)
- type Config
- type Logger
- func (l *Logger) AddCalldepth(n int) log.Logger
- func (l *Logger) Close() error
- func (l *Logger) Error(tag, msg string, fields ...log.Field)
- func (l *Logger) Trace(tag, msg string, fields ...log.Field)
- func (l *Logger) Warning(tag, msg string, fields ...log.Field)
- func (l *Logger) With(fields ...log.Field) log.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Level string `toml:"level"`
}
Config contains all log-related configuration
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the key struct of the log package. It is the part that links the log formatter to the log printer
func (*Logger) AddCalldepth ¶
AddCalldepth clones the logger and changes the call depth
func (*Logger) Error ¶
Error creates a trace log line. Error level logs need immediate attention The 2AM rule applies here, which means that if you are on call, this log line will wake you up at 2AM
func (*Logger) Trace ¶
Trace creates a trace log line. Trace level logs are to follow the code executio step by step
Click to show internal directories.
Click to hide internal directories.