You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
486 B

3 years ago
package log_test
import (
"io"
"gitoa.ru/go-4devs/log/field"
"gitoa.ru/go-4devs/log/handler/zap"
uzap "go.uber.org/zap"
3 years ago
)
func ExampleNew_zapHandler() {
log := zap.New(uzap.NewExample())
log.Err(ctx, "log zap")
log.ErrKV(ctx, "log zap kv", field.Int("int", 42))
log.ErrKVs(ctx, "log zap kv sugar", "err", io.EOF)
3 years ago
// Output:
// {"level":"error","msg":"log zap"}
// {"level":"error","msg":"log zap kv","int":42}
// {"level":"error","msg":"log zap kv sugar","err":"EOF"}
3 years ago
}