Versions in this module Expand all Collapse all v0 v0.0.1 Nov 25, 2024 Changes in this version + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelWarn + const WriteAsync + const WriteFast + const WriteSync + const WriterConsole + const WriterFile + var Levels = map[string]zapcore.Level + func CreateDefaultLogger(cfg []*Config) + func DefaultTimeFormat(t time.Time) []byte + func GetLogEncoderKey(defKey, key string) string + func NewTimeEncoder(format string) zapcore.TimeEncoder + func RegisterWriter(name string, writer Writer) + func Set(name string, logger Logger) + func Sync() + type AsyncFileWriter struct + func NewAsyncFileWriter(logger io.WriteCloser, dropLog bool) *AsyncFileWriter + func (w *AsyncFileWriter) Close() error + func (w *AsyncFileWriter) Sync() error + func (w *AsyncFileWriter) Write(data []byte) (int, error) + type AsyncOptions struct + DropLog bool + QueueSize int + WriteInterval int + WriteSize int + type Config struct + Encoder string + EncoderConfig EncoderConfig + Escape bool + Field []string + FileConfig FileConfig + Level string + ThirdPartyConfig yaml.Node + Writer string + type ConsoleWriter struct + func (f *ConsoleWriter) Setup(cfg *Config) (zapcore.Core, error) + type EncoderConfig struct + CallerKey string + FunctionKey string + LevelKey string + MessageKey string + NameKey string + StacktraceKey string + TimeFmt string + TimeKey string + type Field struct + Key string + Value interface{} + type FileConfig struct + Compress bool + Filename string + LocalTime bool + LogPath string + MaxBackups int + MaxDay int + MaxSize int + WriteMode int + type FileWriter struct + func (f *FileWriter) Setup(cfg *Config) (zapcore.Core, error) + type Logger interface + Debug func(msg string, fields ...Field) + Debugf func(msg string, args ...interface{}) + Error func(msg string, fields ...Field) + Errorf func(msg string, args ...interface{}) + Fatal func(msg string, fields ...Field) + Fatalf func(msg string, args ...interface{}) + Info func(msg string, fields ...Field) + Infof func(msg string, args ...interface{}) + Sync func() error + Warn func(msg string, fields ...Field) + Warnf func(msg string, args ...interface{}) + With func(fields ...Field) Logger + var DefaultLogger Logger + func Get(name string) Logger + type Writer interface + Setup func(cfg *Config) (zapcore.Core, error) + func GetWriter(name string) Writer