Documentation
¶
Index ¶
Constants ¶
const ( // LevelTrace is used for printing verbose network communications LevelTrace = 5 // LevelDebug is used for printing the results of actions which are // essential to the succeeding of the program, but not important enough to // show up in the logs of every server which runs this program LevelDebug = 4 // LevelInfo is used for printing messages which are useful to for knowing // the current state of the application. These messages should not show up // too often, and they should be useful for system administrators to see LevelInfo = 3 // LevelWarning is used for notifying the administrator that something is // wrong, but the application can still function properly LevelWarning = 2 // LevelError is used to indicate that something important broke and the // application is now in an inconsistent state. The problem should be fixed // before restarting the application LevelError = 1 // LevelNone makes the application log no messages at all LevelNone = 0 )
Log level, higher number is more verbosity
Variables ¶
var Colours = false
Colours controls if the log package should print ANSI colour codes depending on the log level of the logged message. Defaults to false
var Logger = log.New(writer(0), "", 0)
Logger is an instance of the standard Go log.Logger which can be used by Go packages to log to the Default log level
Functions ¶
func Error ¶
func Error(msgFmt string, v ...interface{})
Error logs an error message, and prints an execution stack afterwards
func SetDefaultLevel ¶
func SetDefaultLevel(level int)
SetDefaultLevel set the log level for the log messages written to the Write function. This is useful for integrating packages which use Go's native logger interface into this log package.
An example of this is the very verbose http logger which tends to spam logs with messages which can otherwise not be silenced.
func SetLogLevel ¶
func SetLogLevel(level int)
SetLogLevel set the logging verbosity. 0 is lowest (log nothing at all), 5 is highest (log all debug and trace messages)
Types ¶
This section is empty.