Documentation ¶
Overview ¶
Package log offers various logging options
Index ¶
Constants ¶
const AppName string = "goBlue/log"
AppName is the name of the application
const FullVersion string = AppName + VersionMajor + "." + VersionMinor + VersionBuild
FullVersion contains the full name and version of this package in a printable string
const LevelDebug int = 5
LevelDebug debug information
const LevelError int = 3
LevelError any error occurred
const LevelFatal int = 2
LevelFatal fatal error, program can at least exit gracefully
const LevelInfo int = 4
LevelInfo just some information
const LevelPanic int = 1
LevelPanic program cannot continue. Will actually cause a panic!
const LogfileBehaviourAll int = 0
LogfileBehaviourAll Defines if the logger logs everything to one single file
const LogfileBehaviourDaily int = 1
LogfileBehaviourDaily Defines if the logger logs everything to one file for each day (useful for logrotate)
const VersionBuild string = "s"
VersionBuild is the type of this release. s(table), b(eta), d(evelopment), n(ightly)
const VersionMajor string = "0"
VersionMajor 0 means in development, >1 ensures compatibility with each minor version, but breakes with new major version
const VersionMinor string = "1"
VersionMinor introduces changes that require a new version number. If the major version is 0, they are likely to break compatibility
Variables ¶
var CurrentLevel = 4
CurrentLevel defines the current loglevel
var CurrentLogFileBehaviour = LogfileBehaviourAll
CurrentLogFileBehaviour defines current logfile behaviour, defaults to LogfileBehaviourAll
var Logfilename = "log.log"
Logfilename name of the default log
var Path = "."
Path for the default log
var PrintToFile = true
PrintToFile defines which outputs are used, note that panic, fatal and error always prints to error.log, if printToFile is true those are printed to normal log file additionally
var PrintToStderr = true
PrintToStderr defines which outputs are used, note that panic always prints to stderr and ignores this setting, while Info and Debug will never print to stderr
var PrintToStdout = false
PrintToStdout defines which outputs are used, note that everything will be printed to stdout while nothing is printed by default
Functions ¶
Types ¶
This section is empty.