2017-11-03 14:25:48 +00:00
|
|
|
package logger
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.uber.org/zap/zapcore"
|
|
|
|
)
|
|
|
|
|
2019-02-03 20:11:31 +00:00
|
|
|
// Config represents the configuration for creating a zap.Logger.
|
2017-11-03 14:25:48 +00:00
|
|
|
type Config struct {
|
2017-11-03 14:28:25 +00:00
|
|
|
Format string `toml:"format"`
|
|
|
|
Level zapcore.Level `toml:"level"`
|
|
|
|
SuppressLogo bool `toml:"suppress-logo"`
|
2017-11-03 14:25:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig returns a new instance of Config with defaults.
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2018-02-14 16:56:29 +00:00
|
|
|
Format: "auto",
|
2021-03-12 21:34:51 +00:00
|
|
|
Level: zapcore.InfoLevel,
|
2017-11-03 14:25:48 +00:00
|
|
|
}
|
|
|
|
}
|