Documentation ¶
Overview ¶
Package log is a simple logging package that exposes configuration through environment variables.
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(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 SetDebugFlags(flags string)
- func SetDebugOut(location string)
- func SetDebugOutDirect(w io.Writer)
- func SetDefaultFlags(flags string)
- func SetInfoFlags(flags string)
- func SetInfoOut(f string)
- func SetInfoOutDirect(w io.Writer)
- func SetLevel(l int8)
Constants ¶
const ( // OutStdout can be passed to runtime output configuration methods to reset them // to os.Stdout OutStdout = "STDOUT" LevelDebug int8 = 2 LevelInfo int8 = 1 LevelNone int8 = 0 )
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...interface{})
Debug logs debug output. Args are in the style of fmt.Println
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs debug output. Args are in the style of fmt.Printf
func Fatal ¶
func Fatal(v ...interface{})
Fatal logs to stderr and stops program execution (os.Exit) Args are in the style of fmt.Print
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf logs to sterr and stops program execution (os.Exit) Args are in the style of fmt.Printf
func Infof ¶
func Infof(format string, v ...interface{})
Infof logs info output. Args are in the style of fmt.Printf
func SetDebugFlags ¶
func SetDebugFlags(flags string)
SetDebugFlags changes the content of the debug output with a comma-separated list of flags. Valid flags are date,time,microseconds,shortfile,longfile,UTC
func SetDebugOut ¶
func SetDebugOut(location string)
SetDebugOut sets the debug output to a file at location You can pass log.OutStdout to log debug level to os.Stdout
func SetDebugOutDirect ¶
SetDebugOutDirect sets the debug output directly to the given Writer w.
func SetDefaultFlags ¶
func SetDefaultFlags(flags string)
SetDefaultFlags sets flags that will be used for logging adapters with no flags configured. Valid flags are date,time,microseconds,shortfile,longfile,UTC
func SetInfoFlags ¶
func SetInfoFlags(flags string)
SetInfoFlags changes the content of the info output with a comma-separated list of flags. Valid flags are date,time,microseconds,shortfile,longfile,UTC
func SetInfoOut ¶
func SetInfoOut(f string)
SetInfoOut sets the info output to a file at location You can pass log.OutStdout to log info level to os.Stdout
func SetInfoOutDirect ¶
SetInfoOutDirect sets the info output directly to the given Writer w.
Types ¶
This section is empty.