Documentation ¶
Index ¶
- func AddLogConsFlags()
- func AddLogFileFlags()
- func Crit(msg string, ctx ...interface{})
- func Debug(msg string, ctx ...interface{})
- func Error(msg string, ctx ...interface{})
- func Flush()
- func Info(msg string, ctx ...interface{})
- func LogPanicAndExit()
- func RandId(idlen int) string
- func SetupFromFlags(name string) error
- func SetupLogConsole(logConsole string) error
- func SetupLogFile(name string, logDir string, logLevel string, logSize int, logAge int, ...) error
- func Warn(msg string, ctx ...interface{})
- type Handler
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLogConsFlags ¶
func AddLogConsFlags()
func AddLogFileFlags ¶
func AddLogFileFlags()
func LogPanicAndExit ¶
func LogPanicAndExit()
func SetupFromFlags ¶
func SetupLogConsole ¶
func SetupLogFile ¶
func SetupLogFile(name string, logDir string, logLevel string, logSize int, logAge int, logFlush int) error
SetupLogFile initializes a file for logging. The path is logDir/name.log if name doesn't already contain the .log extension, or logDir/name otherwise. logLevel can be one of debug, info, warn, error, and crit and states the minimum level of logging events that get written to the file. logSize is the maximum size, in MiB, until the log rotates. logAge is the maximum number of days to retain old log files. If logFlush > 0, logging output is buffered, and flushed every logFlush seconds. If logFlush < 0: logging output is buffered, but must be manually flushed by calling Flush(). If logFlush = 0 logging output is unbuffered and Flush() is a no-op.