Documentation
¶
Index ¶
- func Close()
- func Error(v ...interface{})
- func ErrorDepth(depth int, v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func FatalDepth(depth int, v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Info(v ...interface{})
- func InfoDepth(depth int, v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func SetFlags(flag int)
- func SetLevel(lvl Level)
- func Warning(v ...interface{})
- func WarningDepth(depth int, v ...interface{})
- func Warningf(format string, v ...interface{})
- func Warningln(v ...interface{})
- type Level
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) ErrorDepth(depth int, v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Errorln(v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) FatalDepth(depth int, v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalln(v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) InfoDepth(depth int, v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Infoln(v ...interface{})
- func (l *Logger) SetLevel(lvl Level)
- func (l *Logger) Verbosity(lvl Level) Verbose
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) WarningDepth(depth int, v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
- func (l *Logger) Warningln(v ...interface{})
- type Verbose
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorDepth ¶
func ErrorDepth(depth int, v ...interface{})
ErrorDepth acts as Error but uses depth to determine which call frame to log. ErrorDepth called with depth 0 is equivalent to Error.
func Errorf ¶
func Errorf(format string, v ...interface{})
Formatted error level logs. Arguments according to fmt.Printf.
func Errorln ¶
func Errorln(v ...interface{})
Newline appended error level logs. Arguments according to fmt.Println.
func Fatal ¶
func Fatal(v ...interface{})
Fatal level logs which terminates with os.Exit(1). Arguments according to fmt.Print.
func FatalDepth ¶
func FatalDepth(depth int, v ...interface{})
FatalDepth acts as Fatal but uses depth to determine which call frame to log. FatalDepth called with depth 0 is equivalent to Fatal.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Formatted Fatal level logs terminates with os.Exit(1). Arguments according to fmt.Printf.
func Fatalln ¶
func Fatalln(v ...interface{})
Newline appended Fatal level logs which terminates with os.Exit(1). Arguments according to fmt.Println.
func InfoDepth ¶
func InfoDepth(depth int, v ...interface{})
InfoDepth acts as Info but uses depth to determine which call frame to log. InfoDepth called with depth 0 is equivalent to Info.
func Infof ¶
func Infof(format string, v ...interface{})
Formatted info level logs. Arguments according to fmt.Printf.
func Infoln ¶
func Infoln(v ...interface{})
Newline appended info level logs. Arguments according to fmt.Println.
func SetLevel ¶
func SetLevel(lvl Level)
Sets the verbosity level for verbose info logging for the default logger.
func Warning ¶
func Warning(v ...interface{})
Warning level logs. Arguments according to fmt.Print.
func WarningDepth ¶
func WarningDepth(depth int, v ...interface{})
WarningDepth acts as Warning but uses depth to determine which call frame to log. WarningDepth called with depth 0 is equivalent to Warning.
Types ¶
type Level ¶
type Level int
Level describes the level of verbosity for info messages when using Verbose logging
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logging object, multiple Loggers can be used simultaneously even if they are using the same writers.
func Init ¶
Init initializes logging and should be called in main(). Default log functions can be called before Init(), but log output will only go to stderr (along with a warning). The first call to Init populates the default logger and returns the generated logger, subsequent calls to Init will only return the generated logger. If the logFd passed in also satisfies io.Closer, logFd.Close will be called when closing the logger.
func (*Logger) Close ¶
func (l *Logger) Close()
Close closes all log writers and will flush any cached logs. Errors from closing the underlying log writers will be printed to stderr. Once Close is called, all future calls to the logger will panic.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error level logs. Arguments according to fmt.Print.
func (*Logger) ErrorDepth ¶
ErrorDepth acts as Error but uses depth to determine which call frame to log. ErrorDepth called with depth 0 is equivalent to Error.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(v ...interface{})
Newline appended error level logs. Arguments according to fmt.Println.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal level logs which terminates with os.Exit(1). Arguments according to fmt.Print.
func (*Logger) FatalDepth ¶
FatalDepth acts as Fatal but uses depth to determine which call frame to log. FatalDepth called with depth 0 is equivalent to Fatal.
func (*Logger) Fatalf ¶
Formatted Fatal level logs terminates with os.Exit(1). Arguments according to fmt.Printf.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(v ...interface{})
Newline appended Fatal level logs which terminates with os.Exit(1). Arguments according to fmt.Println.
func (*Logger) Info ¶
func (l *Logger) Info(v ...interface{})
Info level logs. Arguments according to fmt.Print.
func (*Logger) InfoDepth ¶
InfoDepth acts as Info but uses depth to determine which call frame to log. InfoDepth called with depth 0 is equivalent to Info.
func (*Logger) Infoln ¶
func (l *Logger) Infoln(v ...interface{})
Newline appended info level logs. Arguments according to fmt.Println.
func (*Logger) Verbosity ¶
Verbosity generates a log record depends on the setting of the Level; or none default. It uses the specified logger.
func (*Logger) Warning ¶
func (l *Logger) Warning(v ...interface{})
Warning level logs. Arguments according to fmt.Print.
func (*Logger) WarningDepth ¶
WarningDepth acts as Warning but uses depth to determine which call frame to log. WarningDepth called with depth 0 is equivalent to Warning.
type Verbose ¶
type Verbose struct {
// contains filtered or unexported fields
}
func Verbosity ¶
Verbosity generates a log record, depends on the setting of the Level; or none by default using the default logger.
func (Verbose) Info ¶
func (v Verbose) Info(args ...interface{})
Info is equivalent to Info function, when verbosity(v) is enabled.