Documentation
¶
Overview ¶
Package logging provides logging facilities.
Index ¶
- Variables
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) DebugWriter() io.Writer
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Debugln(v ...interface{})
- func (l *Logger) Error(err error)
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) Sublogger(name string) *Logger
- func (l *Logger) Warn(err error)
- func (l *Logger) Writer() 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 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 information with semantics equivalent to fmt.Print, but only if debugging is enabled (otherwise it's a no-op).
func (*Logger) DebugWriter ¶
DebugWriter returns an io.Writer that writes lines using Debugln.
func (*Logger) Debugf ¶
Debugf logs information with semantics equivalent to fmt.Printf, but only if debugging is enabled (otherwise it's a no-op).
func (*Logger) Debugln ¶
func (l *Logger) Debugln(v ...interface{})
Debugln logs information with semantics equivalent to fmt.Println, but only if debugging is enabled (otherwise it's a no-op).
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print logs information with semantics equivalent to fmt.Print.
func (*Logger) Println ¶
func (l *Logger) Println(v ...interface{})
Println logs information with semantics equivalent to fmt.Println.