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 Log(level Level, v ...interface{})
- func Logf(level Level, format string, v ...interface{})
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type FormatOptions
- type Level
- 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) Log(level Level, v ...interface{})
- func (l *Logger) Logf(level Level, format string, v ...interface{})
- 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 ¶
Functions ¶
Types ¶
type FormatOptions ¶
type FormatOptions struct {
TimePrefix bool
StackPrefix bool
StackLimit int
LevelPrefix bool
LevelColor bool
MessageColor bool
}
FormatOptions defines formatting options for a logger
type Level ¶
type Level int
Level defines a Beaver logging level
func ParseLevel ¶
ParseLevel parses a string and returns a Beaver Level, defaulting to Info
func (Level) Color ¶
Color returns a Level's color, defaulting to bold
func (Level) Prefix ¶
Prefix returns a prefix for a logging level, optionally colored
type Logger ¶
type Logger struct {
Writer io.Writer
Level Level
Format FormatOptions
// contains filtered or unexported fields
}
Logger is a base Beaver logger
func New ¶
func New(writer io.Writer, level Level, opts FormatOptions) *Logger
New returns a new Beaver logger
func (*Logger) Debugf ¶
Debugf formats logs at DEBUG Level
func (*Logger) Errorf ¶
Errorf formats logs at ERROR Level
func (*Logger) Fatalf ¶
Fatalf formats logs at FATAL Level
func (*Logger) Infof ¶
Infof formats logs at INFO Level
func (*Logger) Logf ¶
Low-Level formatted Log
func (*Logger) Tracef ¶
Tracef formats logs at TRACE Level
Source Files
¶
- console.go
- level.go
- logger.go
Click to show internal directories.
Click to hide internal directories.