Documentation
¶
Index ¶
- Constants
- Variables
- func AddDefaultSubscriber(l Logger)
- func EnsureCallerSkip(l Logger, msgKey, callerKey string, fetchOut func() string) error
- type Field
- func Any(key string, val interface{}) Field
- func Binary(key string, val []byte) Field
- func Bool(key string, val bool) Field
- func ByteString(key string, val []byte) Field
- func Duration(key string, val time.Duration) Field
- func Error(err error) Field
- func Errors(key string, val []error) Field
- func Float32(key string, val float32) Field
- func Float64(key string, val float64) Field
- func Int(key string, val int) Field
- func Int16(key string, val int16) Field
- func Int32(key string, val int32) Field
- func Int64(key string, val int64) Field
- func Int8(key string, val int8) Field
- func String(key string, val string) Field
- func Strings(key string, val []string) Field
- func Time(key string, val time.Time) Field
- func Uint(key string, val uint) Field
- func Uint16(key string, val uint16) Field
- func Uint32(key string, val uint32) Field
- func Uint64(key string, val uint64) Field
- func Uint8(key string, val uint8) Field
- type Flavor
- type Level
- type LogCloser
- type Logger
- type RootLogger
- type Tee
Constants ¶
View Source
const ( FlavorConsole = iota FlavorFileStandard // for debug log FlavorFileCapture // for capture log )
View Source
const ( LevelDebug = iota LevelInfo LevelWarn LevelError LevelQuiet )
Variables ¶
View Source
var ( ErrorCallerTestMessageNotFound = errors.New("test message not found in the output") ErrorCallerTestLineIsNotJSON = errors.New("line is not json format") )
Functions ¶
func AddDefaultSubscriber ¶
func AddDefaultSubscriber(l Logger)
Types ¶
type LogCloser ¶
func NewLogCloser ¶
func NewLogCloser(level Level, flavor Flavor, w io.WriteCloser) LogCloser
type Logger ¶
type Logger interface { With(fields ...Field) Logger AddCallerSkip(n int) Logger Debug(msg string, fields ...Field) Info(msg string, fields ...Field) Warn(msg string, fields ...Field) Error(msg string, fields ...Field) Sync() error }
func ConsoleOnly ¶
func ConsoleOnly() Logger
type RootLogger ¶
Click to show internal directories.
Click to hide internal directories.