Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(errorCode int, args ...interface{})
- func Fatalf(errorCode int, format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Output(level LogLevel) io.Writer
- func PWriter(label string, level LogLevel) io.Writer
- func SetLevel(level LogLevel)
- func SetOutput(level LogLevel, w io.Writer)
- func Setup(l *Logger)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Writer(level LogLevel) io.Writer
- type LogLevel
- type LogWriter
- type Logger
- func (l *Logger) Copy() *Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(errorcode int, args ...interface{})
- func (l *Logger) Fatalf(errorcode int, format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Log(level LogLevel, args ...interface{})
- func (l *Logger) Output(level LogLevel) io.Writer
- func (l *Logger) PWriter(label string, level LogLevel) io.Writer
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetOutput(level LogLevel, w io.Writer)
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Writer(level LogLevel) io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogLevel ¶
type LogLevel int8
const ( // DebugLevel is the lowest log level. DebugLevel LogLevel = iota // InfoLevel is the default log level. InfoLevel // WarnLevel is used for warnings. WarnLevel // ErrorLevel is used for errors. ErrorLevel // OutputAll is used to output all log levels in the SetOutput function. OutputAll LogLevel = -1 )
type Logger ¶
type Logger struct { // Level is the log level. Level LogLevel // Prefix is the prefix for each log message. Prefix string // Suffix is the suffix for each log message. Suffix string // Display a timestamp alongside the log message. OutputTime bool // Outputs for the log messages. OutputDebug io.Writer OutputInfo io.Writer OutputWarn io.Writer OutputError io.Writer // WrapPrefix determines how the prefix should be wrapped // based on the LogLevel. WrapPrefix func(LogLevel, string) string }
func (*Logger) Fatal ¶
Fatal is a convenience function for logging an error and exiting the program.
Click to show internal directories.
Click to hide internal directories.