Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LevelAllow ¶
Types ¶
type BaseLogger ¶
type BaseLogger interface {
Log(level Level, vs ...interface{})
Logf(level Level, format string, vs ...interface{})
Level() Level
SetLevel(Level)
}
Concept of a most simple interface:
type FormatText ¶
type FormatText struct {
HasLevel bool
HasDate bool
HasTime bool
HasMicroseconds bool
ShieldSpecial bool // { '\\', '"', '\n', '\r', '\t', '\f' }
}
func (FormatText) Formatter ¶
func (f FormatText) Formatter() Formatter
type FormatWriter ¶
func (*FormatWriter) WriteRecord ¶
func (p *FormatWriter) WriteRecord(r *Record) error
type Formatter ¶
func FormatJSON ¶
func FormatJSON() Formatter
type Level ¶
type Level int
const ( LevelOff Level = iota // log: [ ] LevelCritical // log: [ Critical ] LevelError // log: [ Critical, Error ] LevelWarning // log: [ Critical, Error, Warning ] LevelInfo // log: [ Critical, Error, Warning, Info ] LevelDebug // log: [ Critical, Error, Warning, Info, Debug ] LevelTrace // log: [ Critical, Error, Warning, Info, Debug, Trace ] )
func ParseLevel ¶
func (Level) MarshalText ¶
func (*Level) UnmarshalText ¶
type Logger ¶
type Logger interface {
BaseLogger
Critical(vs ...interface{})
Error(vs ...interface{})
Warning(vs ...interface{})
Info(vs ...interface{})
Debug(vs ...interface{})
Trace(vs ...interface{})
Criticalf(format string, vs ...interface{})
Errorf(format string, vs ...interface{})
Warningf(format string, vs ...interface{})
Infof(format string, vs ...interface{})
Debugf(format string, vs ...interface{})
Tracef(format string, vs ...interface{})
}
func MakeDummyLogger ¶
func MakeDummyLogger() Logger
func MakeLogger ¶
func MakeLoggerStdout ¶
func MakeLoggerStdout() Logger
func NewLoggerRW ¶
func NewLoggerRW(rw RecordWriter) Logger
type RecordWriter ¶
func DummyRecordWriter ¶
func DummyRecordWriter() RecordWriter
func FilterRecordWriter ¶
func FilterRecordWriter(filter func(*Record) bool, rw RecordWriter) RecordWriter
func FuncRecordWriter ¶
func FuncRecordWriter(f func(*Record) error) RecordWriter
func MultiRecordWriter ¶
func MultiRecordWriter(rws ...RecordWriter) RecordWriter
func NewStreamRW ¶
func NewStreamRW(w io.Writer, f Formatter) RecordWriter
Source Files
¶
Click to show internal directories.
Click to hide internal directories.