Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigPrefix = "LOGGER"
ConfigPrefix defines the configuration prefix
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field interface { Key() string Val() interface{} }
Field represents the interface of logger field
type Logger ¶
type Logger interface { AddDefaultField(Field) Debug(msg string, fields ...Field) Info(msg string, fields ...Field) Warn(msg string, fields ...Field) Error(msg string, fields ...Field) Fatal(msg string, fields ...Field) Panic(msg string, fields ...Field) Infof(msg string, data ...interface{}) Warningf(msg string, data ...interface{}) Errorf(msg string, data ...interface{}) }
Logger represents the interface of logger
type Option ¶
type Option func(*Options)
Option represents an option
func DefaultFields ¶
DefaultFields returns default fields option
type Options ¶
type Options struct { Level string `default:"info" envconfig:"LEVEL"` Format string `default:"json" envconfig:"FORMAT"` InstName string `default:"unknown" envconfig:"INST_NAME"` InstVersion string `default:"unknown" envconfig:"INST_VERSION"` DefaultFields []Field `ignored:"true" json:"-"` }
Options represents the logger options
Click to show internal directories.
Click to hide internal directories.