Documentation ¶
Overview ¶
Package logger implements a standardized logger with callback functionality
Index ¶
Constants ¶
View Source
const ( DefaultFlags = log.Ltime | log.Ldate DebugFlags = log.Ltime | log.Ldate | log.Lmicroseconds | log.Lshortfile )
Variables ¶
View Source
var DefaultLogger = New()
DefaultLogger logs to standard output with a time prefix.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct { When time.Time `json:"when"` Message string `json:"message"` Level LogLevel `json:"level"` }
A Line represents a single log entry.
type Logger ¶
type Logger interface { AddHandler(level LogLevel, h MessageHandler) SetFlags(flag int) SetPrefix(prefix string) Debugln(vals ...interface{}) Debugf(format string, vals ...interface{}) Verboseln(vals ...interface{}) Verbosef(format string, vals ...interface{}) Infoln(vals ...interface{}) Infof(format string, vals ...interface{}) Warnln(vals ...interface{}) Warnf(format string, vals ...interface{}) ShouldDebug(facility string) bool SetDebug(facility string, enabled bool) Facilities() map[string]string FacilityDebugging() []string NewFacility(facility, description string) Logger }
type MessageHandler ¶
A MessageHandler is called with the log level and message text.
Click to show internal directories.
Click to hide internal directories.