Documentation
¶
Overview ¶
Package logging provides logging facilities.
Index ¶
- Variables
- type Level
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Sublogger(name string) *Logger
- func (l *Logger) Trace(v ...interface{})
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
- func (l *Logger) Writer(level Level) io.Writer
Constants ¶
This section is empty.
Variables ¶
var RootLogger = &Logger{}
RootLogger is the root logger from which all other loggers derive.
Functions ¶
This section is empty.
Types ¶
type Level ¶ added in v0.11.0
type Level uint8
Level represents a logging level.
const ( // LevelDisabled indicates that logging is completely disabled. LevelDisabled Level = iota // LevelError indicates that only fatal errors are logged. LevelError // LevelWarning indicates that both fatal and non-fatal errors are logged. LevelWarning // LevelInfo indicates that basic execution information is logged (in // addition to all errors). LevelInfo // LevelDebug indicates that advanced execution information is logged (in // addition to basic information and all errors). LevelDebug // LevelTrace indicates that low-level execution information is logged (in // addition to all other execution information and all errors). LevelTrace )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the main logger type. It has the novel property that it still functions if nil, but it doesn't log anything. It is designed to use the standard logger provided by the log package, so it respects any flags set for that logger. It is safe for concurrent usage.
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug logs debug information with formatting semantics equivalent to fmt.Println.
func (*Logger) Debugf ¶
Debugf logs debug information with formatting semantics equivalent to fmt.Printf.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error logs errors with formatting semantics equivalent to fmt.Println.
func (*Logger) Errorf ¶ added in v0.11.0
Errorf logs errors with formatting semantics equivalent to fmt.Printf.
func (*Logger) Info ¶ added in v0.11.0
func (l *Logger) Info(v ...interface{})
Info logs information with formatting semantics equivalent to fmt.Println.
func (*Logger) Infof ¶ added in v0.11.0
Infof logs information with formatting semantics equivalent to fmt.Printf.
func (*Logger) Trace ¶ added in v0.11.0
func (l *Logger) Trace(v ...interface{})
Trace logs tracing information with formatting semantics equivalent to fmt.Println.
func (*Logger) Tracef ¶ added in v0.11.0
Tracef logs tracing information with formatting semantics equivalent to fmt.Printf.
func (*Logger) Warning ¶ added in v0.11.0
func (l *Logger) Warning(v ...interface{})
Warning logs warnings with formatting semantics equivalent to fmt.Println.