Documentation ¶
Overview ¶
NOTE: This package differs from log.Std in the following ways:
- Renamed Std struct to Logger.
- Added Logger.logger field.
- Added New() method.
- Changed Prefix(), log() and logf() methods do not use the stdlog "log" package directly. Instead they use (l *Logger).
Index ¶
- type Logger
- func (l Logger) Debug(msg ...interface{})
- func (l Logger) Debugf(template string, args ...interface{})
- func (l Logger) Error(msg ...interface{})
- func (l Logger) Errorf(template string, args ...interface{})
- func (l Logger) Fatal(msg ...interface{})
- func (l Logger) Fatalf(template string, args ...interface{})
- func (l Logger) Info(msg ...interface{})
- func (l Logger) Infof(template string, args ...interface{})
- func (l *Logger) Level(level ...levels.Type) levels.Type
- func (l *Logger) Named(name string) *Logger
- func (l *Logger) Options(funcs ...func(*Logger) *Logger) *Logger
- func (l Logger) Panic(msg ...interface{})
- func (l Logger) Panicf(template string, args ...interface{})
- func (l *Logger) Prefix(prefix ...string) string
- func (l Logger) Trace(msg ...interface{})
- func (l Logger) Tracef(template string, args ...interface{})
- func (l Logger) Warn(msg ...interface{})
- func (l Logger) Warnf(template string, args ...interface{})
- func (l *Logger) WithLevel(level levels.Type) *Logger
- func (l *Logger) WithLevelFromDebug(debug bool) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a wrapper around an instance of a logger from the Go standard library.
func New ¶
New creates an instance of std.Logger that wraps a logger from the standard library. It takes a logger from the standard library as an argument. This is now it differs from log.NewStandard() which is used by default. The logger is configurable.
func NewStandard ¶
func NewStandard() *Logger
NewStandard sets up a basic logger using the general one provided in the Go standard library.