Documentation ¶
Overview ¶
Package log provides a useful logging subsystem for Hologram tools.
By default, it will log INFO-level messages to the system log and standard out, but DEBUG-level messages can be output to these sinks as well. By defaut DEBUG messages are suppressed.
Messages emitted to the terminal are colourised for easy visual parsing, if the terminal supports it. The following colours are used:
- Info: White
- Warning: Yellow
- Error: Red
- Debug: Cyan
The log format is as follows:
[WARNING] 06/11/2014 18:22:34Z Message text. [ERROR ] 06/11/2014 18:22:56Z Time to fail.
Index ¶
- func Debug(message string, v ...interface{})
- func DebugMode(status bool)
- func Errorf(message string, v ...interface{})
- func Info(message string, v ...interface{})
- func NewColourisedTerminalSink() *terminalSink
- func NewMux() *logMux
- func NewSyslogSink() *syslogSink
- func Warning(message string, v ...interface{})
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugMode ¶
func DebugMode(status bool)
DebugMode sets the debug mode option for this built-in logger.
func NewColourisedTerminalSink ¶
func NewColourisedTerminalSink() *terminalSink
Return a working logger that colourises output to the terminal according to level.