Documentation ¶
Overview ¶
Package log includes logging related manipulations.
log.Level = log.Debug logger := log.NewLogger(os.Stdout) logger.Trace("trace message) logger.Debug("debug message") logger.Info("info message") logger.Warn("warning message") logger.Error("error message") logger.Errorf("formatted %s message", "error")
Index ¶
- Constants
- func SetLevel(level string)
- 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) 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 string)
- 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 ¶
View Source
const ( Off = iota Trace Debug Info Warn Error )
Logging level.
Variables ¶
This section is empty.
Functions ¶
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) 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.