update zap/logrus hanler (#1)
Co-authored-by: andrey1s <andrey_simfi@list.ru> Reviewed-on: #1 Co-authored-by: andrey <andrey@4devs.io> Co-committed-by: andrey <andrey@4devs.io>
This commit was merged in pull request #1.
This commit is contained in:
@@ -14,6 +14,8 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
buf := &bytes.Buffer{}
|
||||
core := zapcore.NewCore(zapcore.NewJSONEncoder(zapcore.EncoderConfig{
|
||||
@@ -24,7 +26,7 @@ func TestNew(t *testing.T) {
|
||||
EncodeTime: zapcore.ISO8601TimeEncoder,
|
||||
EncodeDuration: zapcore.StringDurationEncoder,
|
||||
}), zapcore.AddSync(buf), zapcore.DebugLevel)
|
||||
logger := zlog.New(zlog.WithZap(zap.New(core)))
|
||||
logger := zlog.New(zap.New(core))
|
||||
expect := `{"level":"info","msg":"handle zap message","env":"test"}` + "\n"
|
||||
|
||||
if _, err := logger(ctx, entry.New(
|
||||
|
||||
Reference in New Issue
Block a user