Documentation ¶
Index ¶
- Constants
- func DPanic(msg string, fields ...zapcore.Field)
- func Debug(msg string, fields ...zapcore.Field)
- func Error(msg string, fields ...zapcore.Field)
- func Fatal(msg string, fields ...zapcore.Field)
- func Info(msg string, fields ...zapcore.Field)
- func InitLogger(conf Config) *zap.Logger
- func Initialize(cfp string)
- func Panic(msg string, fields ...zapcore.Field)
- func Sync() error
- func Warn(msg string, fields ...zapcore.Field)
- type Config
- type LineContext
- type Output
Constants ¶
View Source
const (
DefaultConfigFilePath = "logger.toml"
)
--------------------------------------------------------------------------------------------------
View Source
const DefaultOutputFolder = "/tmp/"
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize(cfp string)
Types ¶
type Config ¶
type Config struct { Level string `mapstructure:"level" json:"level" yaml:"level" toml:"level"` Context LineContext `mapstructure:"context" json:"context" yaml:"context" toml:"context"` Output Output `mapstructure:"output" json:"output" yaml:"output" toml:"output"` }
Config logger config
type LineContext ¶
type LineContext struct { Format string `mapstructure:"format" json:"format" yaml:"format" toml:"format"` Fileds map[string]string `mapstructure:"fileds" json:"fileds" yaml:"fileds" toml:"fileds"` ShowCaller bool `mapstructure:"show_caller" json:"show_caller" yaml:"show_caller" toml:"show_caller"` }
LineContext log context config
type Output ¶
type Output struct { File bool `mapstructure:"file" json:"file" yaml:"file" toml:"file"` FilePath string `mapstructure:"file_path" json:"file_path" yaml:"file_path" toml:"file_path"` MaxSize int `mapstructure:"max_size" json:"max_size" yaml:"max_size" toml:"max_size"` MaxBackups int `mapstructure:"max_backups" json:"max_backups" yaml:"max_backups" toml:"max_backups"` MaxAge int `mapstructure:"max_age" json:"max_age" yaml:"max_age" toml:"max_age"` Compress bool `mapstructure:"compress" json:"compress" yaml:"compress" toml:"compress"` Console bool `mapstructure:"console" json:"console" yaml:"console" toml:"console"` }
Output log output config
Click to show internal directories.
Click to hide internal directories.