Documentation ¶
Index ¶
- Variables
- 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 LevelType)
- func SetOutput(w io.Writer)
- func SetSyncOutput(b bool)
- func Warn(v interface{})
- func Warnf(format string, v interface{})
- type Color
- type LevelEnum
- type LevelType
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) IsDebugEnabled() bool
- func (l *Logger) IsTraceEnabled() bool
- func (l *Logger) IsWarnEnabled() bool
- func (l *Logger) SetLevel(level LevelType)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Trace(v ...interface{})
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var Level = LevelEnum{
INFO: "info",
DEBUG: "debug",
OFF: "off",
TRACE: "trace",
WARN: "warn",
ERROR: "error",
FATAL: "fatal",
}
Functions ¶
func Fatalf ¶
func Fatalf(format string, v interface{})
Fatalf prints fatal level msg with format and exit process with code 1.
func SetLevel ¶
func SetLevel(level LevelType)
SetLevel sets the logging level of all loggers. (global)
func SetSyncOutput ¶
func SetSyncOutput(b bool)
SetSyncOutput synchronize output settings to the default log library
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a simple logger with level. The underlying logger is the standard Go logging "log".
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal prints fatal level msg and exit process with code 1.
func (*Logger) IsDebugEnabled ¶
IsDebugEnabled determines whether the debug level is enabled.
func (*Logger) IsTraceEnabled ¶
IsTraceEnabled determines whether the trace level is enabled.
func (*Logger) IsWarnEnabled ¶
IsWarnEnabled determines whether the debug level is enabled.
Click to show internal directories.
Click to hide internal directories.