Documentation
¶
Index ¶
- type Logger
- func (l Logger) Debug(msg ...interface{})
- func (l Logger) Debugf(template string, args ...interface{})
- func (l Logger) Debugw(msg string, fields log.Fields)
- func (l Logger) Error(msg ...interface{})
- func (l Logger) Errorf(template string, args ...interface{})
- func (l Logger) Errorw(msg string, fields log.Fields)
- func (l Logger) Fatal(msg ...interface{})
- func (l Logger) Fatalf(template string, args ...interface{})
- func (l Logger) Fatalw(msg string, fields log.Fields)
- func (l Logger) Info(msg ...interface{})
- func (l Logger) Infof(template string, args ...interface{})
- func (l Logger) Infow(msg string, fields log.Fields)
- func (l Logger) Panic(msg ...interface{})
- func (l Logger) Panicf(template string, args ...interface{})
- func (l Logger) Panicw(msg string, fields log.Fields)
- func (l Logger) Trace(msg ...interface{})
- func (l Logger) Tracef(template string, args ...interface{})
- func (l Logger) Tracew(msg string, fields log.Fields)
- func (l Logger) Warn(msg ...interface{})
- func (l Logger) Warnf(template string, args ...interface{})
- func (l Logger) Warnw(msg string, fields log.Fields)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// TraceOut provides a writer to write trace messages to
TraceOut io.Writer
// DebugOut provides a writer to write debug messages to
DebugOut io.Writer
// InfoOut provides a writer to write info messages to
InfoOut io.Writer
// WarnOut provides a writer to write warning messages to
WarnOut io.Writer
// ErrorOut provides a writer to write error messages to
ErrorOut io.Writer
// PanicOut provides a writer to write panic messages to
PanicOut io.Writer
// FatalOut provides a writer to write fatal messages to
FatalOut io.Writer
// Level sets the current logging level
Level int
// Colors used for each of the levels. Note, the Info level intentionally
// does not have a color. It will use the tty default.
TraceColor *color.Color
DebugColor *color.Color
WarnColor *color.Color
ErrorColor *color.Color
PanicColor *color.Color
FatalColor *color.Color
}
Logger provides a CLI based logger. Log messages are written to the CLI as terminal style output.
func (Logger) Debug ¶
func (l Logger) Debug(msg ...interface{})
Debug logs a message at the Debug level
func (Logger) Debugf ¶
Debugf formats a message according to a format specifier and logs the message at the Debug level
func (Logger) Debugw ¶
Debugw logs a message at the Debug level along with some additional context (key-value pairs)
func (Logger) Error ¶
func (l Logger) Error(msg ...interface{})
Error logs a message at the Error level
func (Logger) Errorf ¶
Errorf formats a message according to a format specifier and logs the message at the Error level
func (Logger) Errorw ¶
Errorw logs a message at the Error level along with some additional context (key-value pairs)
func (Logger) Fatal ¶
func (l Logger) Fatal(msg ...interface{})
Fatal logs a message at the Fatal level and exists the application
func (Logger) Fatalf ¶
Fatalf formats a message according to a format specifier and logs the message at the Fatal level and exits the application
func (Logger) Fatalw ¶
Fatalw logs a message at the Fatal level along with some additional context (key-value pairs) and exits the application
func (Logger) Infof ¶
Infof formats a message according to a format specifier and logs the message at the Info level
func (Logger) Infow ¶
Infow logs a message at the Info level along with some additional context (key-value pairs)
func (Logger) Panic ¶
func (l Logger) Panic(msg ...interface{})
Panic logs a message at the Panic level and panics
func (Logger) Panicf ¶
Panicf formats a message according to a format specifier and logs the message at the Panic level and then panics
func (Logger) Panicw ¶
Panicw logs a message at the Panic level along with some additional context (key-value pairs) and then panics
func (Logger) Trace ¶
func (l Logger) Trace(msg ...interface{})
Trace logs a message at the Trace level
func (Logger) Tracef ¶
Tracef formats a message according to a format specifier and logs the message at the Trace level
func (Logger) Tracew ¶
Tracew logs a message at the Trace level along with some additional context (key-value pairs)