Documentation ¶
Index ¶
- Variables
- func Critf(format string, rest ...interface{})
- func Debugf(format string, rest ...interface{})
- func Errf(format string, rest ...interface{})
- func Fatalf(format string, rest ...interface{})
- func Infof(format string, rest ...interface{})
- func Log(lvl Level) bool
- func LogDebug() bool
- func LogVerbose() bool
- func LogVf(format string, rest ...interface{})
- func Logf(lvl Level, format string, rest ...interface{})
- func SetFlags(f int)
- func SetOutput(w io.Writer)
- func Warnf(format string, rest ...interface{})
- type Level
Constants ¶
This section is empty.
Variables ¶
View Source
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") )
Functions ¶
func Logf ¶
Logf logs with format at the given level. 2 level of calls so it's always same depth for extracting caller file/line
Types ¶
type Level ¶
type Level int
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.
func SetLogLevel ¶
SetLogLevel sets the log level and returns the previous one.
func SetLogLevelQuiet ¶ added in v0.6.4
SetLogLevelQuiet sets the log level and returns the previous one but does not log the change of level itself.
Click to show internal directories.
Click to hide internal directories.