Documentation ¶
Overview ¶
Package logger implements a standardized logger with callback functionality
Index ¶
- Variables
- type LogLevel
- type Logger
- func (l *Logger) AddHandler(level LogLevel, h MessageHandler)
- func (l *Logger) Debugf(format string, vals ...interface{})
- func (l *Logger) Debugln(vals ...interface{})
- func (l *Logger) Fatalf(format string, vals ...interface{})
- func (l *Logger) Fatalln(vals ...interface{})
- func (l *Logger) Infof(format string, vals ...interface{})
- func (l *Logger) Infoln(vals ...interface{})
- func (l *Logger) Okf(format string, vals ...interface{})
- func (l *Logger) Okln(vals ...interface{})
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Warnf(format string, vals ...interface{})
- func (l *Logger) Warnln(vals ...interface{})
- type MessageHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = New()
The default logger logs to standard output with a time prefix.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) AddHandler ¶
func (l *Logger) AddHandler(level LogLevel, h MessageHandler)
AddHandler registers a new MessageHandler to receive messages with the specified log level or above.
func (*Logger) Debugln ¶
func (l *Logger) Debugln(vals ...interface{})
Debugln logs a line with a DEBUG prefix.
func (*Logger) Fatalf ¶
Fatalf logs a formatted line with a FATAL prefix and exits the process with exit code 1.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(vals ...interface{})
Fatalln logs a line with a FATAL prefix and exits the process with exit code 1.
func (*Logger) Infoln ¶
func (l *Logger) Infoln(vals ...interface{})
Infoln logs a line with an INFO prefix.
func (*Logger) Okln ¶
func (l *Logger) Okln(vals ...interface{})
Okln logs a line with an OK prefix.
type MessageHandler ¶
A MessageHandler is called with the log level and message text.
Click to show internal directories.
Click to hide internal directories.