# README
go-easylog
easy package by zap
Usage
Quick start
easyzap.Info("info")
easyzap.Warn("warn")
easyzap.Error("error")
Inject
easyzap.Inject(easyzap.New(&Config{
LogDir: "logs/",
Filename: "out.log",
Level: zapcore.InfoLevel,
}))
easyzap.Info("info")
easyzap.Warn("warn")
easyzap.Error("error")
New
zlog := New(&Config{
LogDir: "logs/",
Filename: "out.log",
Level: zapcore.InfoLevel,
})
zlog.Info("info")
zlog.Warn("warn")
zlog.Error("error")
# Functions
Debug uses fmt.Sprint to construct and log a message.
Debugf uses fmt.Sprintf to log a templated message.
Debugw logs a message with some additional context.
DPanic uses fmt.Sprint to construct and log a message.
DPanicf uses fmt.Sprintf to log a templated message.
DPanicw logs a message with some additional context.
Error uses fmt.Sprint to construct and log a message.
Errorf uses fmt.Sprintf to log a templated message.
Errorw logs a message with some additional context.
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
Fatalw logs a message with some additional context, then calls os.Exit.
Info uses fmt.Sprint to construct and log a message.
Infof uses fmt.Sprintf to log a templated message.
Infow logs a message with some additional context.
Inject ...
New.
Panic uses fmt.Sprint to construct and log a message, then panics.
Panicf uses fmt.Sprintf to log a templated message, then panics.
Panicw logs a message with some additional context, then panics.
Sync flushes any buffered log entries.
Warn uses fmt.Sprint to construct and log a message.
Warnf uses fmt.Sprintf to log a templated message.
Warnw logs a message with some additional context.
Note that the keys in key-value pairs should be strings.