Documentation ¶
Overview ¶
Package console implements simple hierarchical logging functionality.
Index ¶
- Constants
- func Debug(msg string, a ...interface{})
- func Info(msg string, a ...interface{})
- func Init(prefix string, flag int)
- func LogLevel() string
- func SetLogLevel(level uint8)
- func Status(msg string, a ...interface{})
- func Trace(msg string, a ...interface{})
- func Warn(msg string, a ...interface{})
- func Warne(err error)
Constants ¶
const ( LevelTrace uint8 = iota LevelDebug LevelInfo LevelStatus LevelWarn LevelSilent )
Levels for implementing the debug and trace message functionality.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(msg string, a ...interface{})
Debug prints to the standard logger if level is debug or greater; arguments are handled in the manner of log.Printf, but a newline is appended.
func Info ¶
func Info(msg string, a ...interface{})
Info prints to the standard logger if level is info or greater; arguments are handled in the manner of log.Printf, but a newline is appended.
func LogLevel ¶
func LogLevel() string
LogLevel returns a string representation of the current level.
func SetLogLevel ¶
func SetLogLevel(level uint8)
SetLogLevel modifies the log level for messages at runtime. Ensures that the highest level that can be set is the trace level. This function is often called from outside of the package in an init() function to define how logging is handled in the console.
func Status ¶
func Status(msg string, a ...interface{})
Status prints to the standard logger if level is status or greater; arguments are handled in the manner of log.Printf, but a newline is appended.
func Trace ¶
func Trace(msg string, a ...interface{})
Trace prints to the standard logger if level is trace or greater; arguments are handled in the manner of log.Printf, but a newline is appended.
Types ¶
This section is empty.