Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(format string, toLog ...interface{})
- func Error(format string, toLog ...interface{})
- func Fatal(format string, toLog ...interface{})
- func Info(format string, toLog ...interface{})
- func Output(format string, toLog ...interface{})
- func OutputStream(reader io.Reader)
- func Panic(format string, toLog ...interface{})
- func SetLevel(level Level)
- func Verbose(format string, toLog ...interface{})
- func Warning(format string, toLog ...interface{})
- type Level
Constants ¶
const DefaultLevel = LevelInfo
DefaultLevel is the default log level.
const MaxLevel = LevelDebug
MaxLevel is the highest value allowed for a log level.
const MinLevel = LevelNone
MinLevel is the lowest value allowed for a log level.
Variables ¶
var WriterErr = os.Stderr
WriterErr is the stream to use when writing error or warning logs.
var WriterInfo = os.Stdout
WriterInfo is the stream to use when writing info or error logs.
var WriterOut = os.Stdout
WriterOut is the stream to use when writing program output.
Functions ¶
func Debug ¶
func Debug(format string, toLog ...interface{})
Debug logs the formatted message as a debug message.
func Error ¶
func Error(format string, toLog ...interface{})
Error logs the formatted message as an error.
func Fatal ¶
func Fatal(format string, toLog ...interface{})
Fatal logs the formatted message as an error, and then exits.
func Info ¶
func Info(format string, toLog ...interface{})
Info logs the formatted message as an informational message.
func Output ¶
func Output(format string, toLog ...interface{})
Output logs the formatted message as output, without any prefixes or logging flags turned on.
func OutputStream ¶
OutputStream writes all bytes from the given reader as output.
func Panic ¶
func Panic(format string, toLog ...interface{})
Panic logs the formatted message as an error, and then panics.
Types ¶
type Level ¶
type Level int
Level identifies the severity of a log line.
const ( // LevelNone indicates that logs should not be sent to output. LevelNone Level = iota // LevelError indicates that error logs should be sent to output. LevelError // LevelWarning indicates that warning and error logs should be sent to output. LevelWarning // LevelInfo indicates that info, warning and error logs should be sent to output. LevelInfo // LevelVerbose indicates that verbose, info, warning and error logs should be sent to output. LevelVerbose // LevelDebug indicates that debug, verbose, info, warning and error logs should be sent to output. LevelDebug )
Level enum