var ( // LogPrefix is a prefix to include in each log line. LogPrefix = flag.String("logprefix", "> ", "Prefix to log lines before logged messages") // LogFileAndLine determines if the log lines will contain caller file name and line number. LogFileAndLine = flag.Bool("logcaller", true, "Logs filename and line number of callers to log") )
Critf logs if Warning level is on.
Debugf logs if Debug level is on.
Errf logs if Warning level is on.
Fatalf logs if Warning level is on.
Infof logs if Info level is on.
Log returns true if a given level is currently logged.
LogDebug shortcut for fortio.Log(fortio.Debug)
LogVerbose shortcut for fortio.Log(fortio.Verbose)
LogVf logs if Verbose level is on.
Logf logs with format at the given level. 2 level of calls so it's always same depth for extracting caller file/line
SetFlags forwards flags to the system logger.
SetOutput sets the output to a different writer (forwards to system logger).
Warnf logs if Warning level is on.
Level is the level of logging (0 Debug -> 6 Fatal).
Log levels. Go can't have variable and function of the same name so we keep medium length (Dbg,Info,Warn,Err,Crit,Fatal) names for the functions.
GetLogLevel returns the currently configured LogLevel.
LevelByName returns the LogLevel by its name.
SetLogLevel sets the log level and returns the previous one.
SetLogLevelQuiet sets the log level and returns the previous one but does not log the change of level itself.
Set is called by the flags.
String returns the string representation of the level. Needed for flag Var interface.
ToString returns the string representation of the level. (this can't be the same name as the pointer receiver version)