Documentation ¶
Index ¶
- Constants
- Variables
- func ColorsSupported() bool
- type ConsoleLogger
- func (l *ConsoleLogger) Debug(format string, v ...interface{})
- func (l *ConsoleLogger) Error(format string, v ...interface{})
- func (l *ConsoleLogger) Fatal(format string, v ...interface{})
- func (l *ConsoleLogger) Info(format string, v ...interface{})
- func (l *ConsoleLogger) Level() Level
- func (l *ConsoleLogger) Notice(format string, v ...interface{})
- func (l *ConsoleLogger) SetLevel(level Level)
- func (l *ConsoleLogger) Warn(format string, v ...interface{})
- func (l *ConsoleLogger) WithFields(fields ...Field) Logger
- type Field
- type Fields
- type GenericField
- type JSONPrinter
- type Level
- type Logger
- type Printer
- type TextPrinter
Constants ¶
View Source
const (
DateFormat = "2006-01-02 15:04:05"
)
Variables ¶
View Source
var Discard = &ConsoleLogger{ printer: &TextPrinter{ Writer: ioutil.Discard, }, }
Functions ¶
func ColorsSupported ¶
func ColorsSupported() bool
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
// contains filtered or unexported fields
}
func (*ConsoleLogger) Debug ¶
func (l *ConsoleLogger) Debug(format string, v ...interface{})
func (*ConsoleLogger) Error ¶
func (l *ConsoleLogger) Error(format string, v ...interface{})
func (*ConsoleLogger) Fatal ¶
func (l *ConsoleLogger) Fatal(format string, v ...interface{})
func (*ConsoleLogger) Info ¶
func (l *ConsoleLogger) Info(format string, v ...interface{})
func (*ConsoleLogger) Level ¶
func (l *ConsoleLogger) Level() Level
func (*ConsoleLogger) Notice ¶
func (l *ConsoleLogger) Notice(format string, v ...interface{})
func (*ConsoleLogger) SetLevel ¶
func (l *ConsoleLogger) SetLevel(level Level)
SetLevel sets the level in the logger
func (*ConsoleLogger) Warn ¶
func (l *ConsoleLogger) Warn(format string, v ...interface{})
func (*ConsoleLogger) WithFields ¶
func (l *ConsoleLogger) WithFields(fields ...Field) Logger
WithFields returns a copy of the logger with the provided fields
type Field ¶
func StringField ¶
type GenericField ¶
type GenericField struct {
// contains filtered or unexported fields
}
func (GenericField) Key ¶
func (f GenericField) Key() string
func (GenericField) String ¶
func (f GenericField) String() string
type JSONPrinter ¶
func NewJSONPrinter ¶
func NewJSONPrinter(w io.Writer) *JSONPrinter
type Logger ¶
type Logger interface { Debug(format string, v ...interface{}) Error(format string, v ...interface{}) Fatal(format string, v ...interface{}) Notice(format string, v ...interface{}) Warn(format string, v ...interface{}) Info(format string, v ...interface{}) WithFields(fields ...Field) Logger SetLevel(level Level) Level() Level }
func NewConsoleLogger ¶
type TextPrinter ¶
type TextPrinter struct { Colors bool Writer io.Writer IsPrefixFn func(Field) bool IsVisibleFn func(Field) bool }
func NewTextPrinter ¶
func NewTextPrinter(w io.Writer) *TextPrinter
Click to show internal directories.
Click to hide internal directories.