var ( LevelFlagOptions = []string{"debug", "info", "warn", "error"} FormatFlagOptions = []string{"logfmt", "json"} )
func New(config *Config) log.Logger
New returns a new leveled oklog logger. Each logged line will be annotated with a timestamp. The output always goes to stderr.
func NewDynamic(config *Config) *logger
NewDynamic returns a new leveled logger. Each logged line will be annotated with a timestamp. The output always goes to stderr. Some properties can be changed, like the level.
func NewDynamicWithLogger(l log.Logger, config *Config) *logger
NewDynamicWithLogger returns a new leveled logger with a custom io.Writer. Each logged line will be annotated with a timestamp. Some properties can be changed, like the level.
func NewWithLogger(l log.Logger, config *Config) log.Logger
NewWithLogger returns a new leveled oklog logger with a custom log.Logger. Each logged line will be annotated with a timestamp.
AllowedFormat is a settable identifier for the output format that the logger can have.
type AllowedFormat struct {
// contains filtered or unexported fields
}
func (f *AllowedFormat) Set(s string) error
Set updates the value of the allowed format.
func (f *AllowedFormat) String() string
AllowedLevel is a settable identifier for the minimum level a log entry must be have.
type AllowedLevel struct {
// contains filtered or unexported fields
}
func (l *AllowedLevel) Set(s string) error
Set updates the value of the allowed level.
func (l *AllowedLevel) String() string
func (l *AllowedLevel) UnmarshalYAML(unmarshal func(interface{}) error) error
Config is a struct containing configurable settings for the logger
type Config struct { Level *AllowedLevel Format *AllowedFormat }