Documentation
¶
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetLevel(level Level)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...interface{})
Debug calls Golang's log.Print which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Debug or above. Arguments are handled in the manner of fmt.Print.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls Golang's log.Printf which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Debug or above. Arguments are handled in the manner of fmt.Printf.
func Error ¶
func Error(v ...interface{})
Error calls Golang's log.Print which in turn calls Output to print to the standard logger. It will call log.Printf if the log level is set Error or above. Arguments are handled in the manner of fmt.Print.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls Golang's log.Printf which in turn calls Output to print to the standard logger. It will call log.Printf if the log level is set Error or above. Arguments are handled in the manner of fmt.Printf.
func Fatal ¶
func Fatal(v ...interface{})
Fatal is equivalent to Print() followed by a call to os.Exit(1).
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
func Info ¶
func Info(v ...interface{})
Info calls Golang's log.Print which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Info or above. Arguments are handled in the manner of fmt.Print.
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls Golang's log.Printf which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Info or above. Arguments are handled in the manner of fmt.Printf.
func SetLevel ¶
func SetLevel(level Level)
SetLevel is used to set the logging level. This library only support setting logging level globally. The possible arguments to this function are: LevelFatal, LevelError, LevelWarn, LevelInfo, LevelDebug and LevelTrace.
func Trace ¶
func Trace(v ...interface{})
Trace calls Golang's log.Print which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Trace or above. Arguments are handled in the manner of fmt.Print.
func Tracef ¶
func Tracef(format string, v ...interface{})
Tracef calls Golang's log.Printf which in turn calls Output to print to the standard logger. It will only call log.Printf if the log level is set Trace or above. Arguments are handled in the manner of fmt.Printf.
Types ¶
type Level ¶
type Level int
Level Log level to use in `SetLevel()` function
const ( // LevelFatal to be used with `SetLevel(LevelFatal)`, to set log level to only Fatal calls LevelFatal Level = iota // LevelError to be used with `SetLevel(LevelError)`, to set log level to Error and Fatal calls LevelError Level = iota // LevelWarn to be used with `SetLevel(LevelWarn)`, to set log level to Error, Fatal and Warn calls LevelWarn Level = iota // LevelInfo to be used with `SetLevel(LevelInfo)`, to set log level to Error, Fatal, Warn and Info cals LevelInfo Level = iota // LevelDebug to be used with `SetLevel(LevelDebug)`, to set log level to Error, Fatal, Warn, Info and Debug calls. LevelDebug Level = iota // LevelTrace to be used with `SetLevel(LevelTrace)`, it enables all log levels. LevelTrace Level = iota )
func ParseLevel ¶
ParseLevel takes as string and return the corresponding level. The strLevel argument is case insensitive. The strLevel argument just needs to begin with one of the logging level names. Logging level names are TRACE, DEBUG, INFO, WARN, ERROR and FATAL
e.g.: ParseLevel("debug") // LevelDebug e.g.: ParseLevel("DEBUG") // LevelDebug e.g.: ParseLevel("debugging") // LevelDebug e.g.: ParseLevel("warn") // LevelWarn e.g.: ParseLevel("warni") // LevelWarn e.g.: ParseLevel("warnin") // LevelWarn e.g.: ParseLevel("warning") // LevelWarn e.g.: ParseLevel("WARNING") // LevelWarn