package zaplog
Import Path
go.pact.im/x/zaplog (on go.dev)
Dependency Relation
imports 3 packages, and imported by 0 packages
Code Examples
package main
import (
"go.pact.im/x/zaplog"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"io"
"os"
)
func main() {
lg := zaplog.Tee(zaplog.New(io.Discard).With(
// Note that Tee does carry existing context to the target
// core since it’s attached to the current core only.
zap.String("ignored", "oops"),
), zapcore.NewCore(
zapcore.NewConsoleEncoder(zapcore.EncoderConfig{
MessageKey: "msg",
LevelKey: "level",
EncodeLevel: zapcore.LowercaseLevelEncoder,
ConsoleSeparator: ": ",
}),
zapcore.AddSync(os.Stdout),
zap.DebugLevel,
)).With(zap.String("shark", "gawr gura"))
lg.Debug("cheeki breeki")
}
Package-Level Functions (total 2, both are exported)