MCPcopy Create free account
hub / github.com/Shopify/ghostferry / NewSlogLogger

Function NewSlogLogger

slog_handler.go:127–129  ·  view source on GitHub ↗

NewSlogLogger returns a *slog.Logger that routes all log output through the given ghostferry Logger. Use this to bridge third-party libraries that log via log/slog into ghostferry's active backend (zerolog or logrus). Example — route go-mysql BinlogSyncer logs through a tagged ghostferry logger:

(logger Logger)

Source from the content-addressed store, hash-verified

125// Logger: ghostferry.NewSlogLogger(ghostferry.LogWithField("tag", "binlog_syncer")),
126// }
127func NewSlogLogger(logger Logger) *slog.Logger {
128 return slog.New(&loggerSlogHandler{logger: logger})
129}

Calls

no outgoing calls