Documentation
¶
Index ¶
- 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 GetAtomicLevel(level string) zap.AtomicLevel
- func GetAtomicLevelEnableFuncEqual(level string) zap.LevelEnablerFunc
- func GetLogger() *zap.Logger
- func Info(msg string, fields ...zapcore.Field)
- func Init(c *LogConfig)
- func Panic(msg string, fields ...zapcore.Field)
- func Sync()
- func Warn(msg string, fields ...zapcore.Field)
- type ConsoleLogger
- type DflogLogger
- type FileLogger
- type LogConfig
- type MLogger
- type NlogLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAtomicLevel ¶
func GetAtomicLevel(level string) zap.AtomicLevel
func GetAtomicLevelEnableFuncEqual ¶
func GetAtomicLevelEnableFuncEqual(level string) zap.LevelEnablerFunc
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
}
func (*ConsoleLogger) Init ¶
func (l *ConsoleLogger) Init(c *LogConfig) zapcore.WriteSyncer
type DflogLogger ¶
type DflogLogger struct {
// contains filtered or unexported fields
}
func (*DflogLogger) Init ¶
func (d *DflogLogger) Init(c *LogConfig) zapcore.WriteSyncer
type FileLogger ¶
type FileLogger struct {
}
func (*FileLogger) Init ¶
func (f *FileLogger) Init(c *LogConfig) zapcore.WriteSyncer
type LogConfig ¶
type LogConfig struct {
// AppName
Name string `yaml:"name" json:"name"`
// console file nlog
Mode string `yaml:"mode" json:"mode"`
// debug info warn error
Level string `yaml:"level" json:"level"`
// file path
FilePath string `yaml:"file_path" json:"file_path"`
// file max size
FileMaxSize int `yaml:"file_max_size" json:"file_max_size"`
// file retain days
FileRetainDays int `yaml:"file_retain_days" json:"file_retain_days"`
// file max backups
FileMaxBackups int `yaml:"file_max_backups" json:"file_max_backups"`
// file compress
FileCompress bool `yaml:"file_compress" json:"file_compress"`
// nlog tags
NlogTags map[string]string `yaml:"nlog_tag" json:"nlog_tag"`
// nlog remote addr
NlogRemoteAddr string `yaml:"nlog_remote_addr" json:"nlog_remote_addr"`
DflogSubsys string `yaml:"dflog_subsys" json:"dflog_subsys"`
DflogModule string `yaml:"dflog_module" json:"dflog_module"`
DflogRemoteAddr string `yaml:"dflog_remote_addr" json:"dflog_remote_addr"`
}
type MLogger ¶
type MLogger interface {
Init(c *LogConfig) zapcore.WriteSyncer
}
type NlogLogger ¶
type NlogLogger struct {
// contains filtered or unexported fields
}
func (*NlogLogger) Init ¶
func (n *NlogLogger) Init(c *LogConfig) zapcore.WriteSyncer
Source Files
¶
Click to show internal directories.
Click to hide internal directories.