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)
| 125 | // Logger: ghostferry.NewSlogLogger(ghostferry.LogWithField("tag", "binlog_syncer")), |
| 126 | // } |
| 127 | func NewSlogLogger(logger Logger) *slog.Logger { |
| 128 | return slog.New(&loggerSlogHandler{logger: logger}) |
| 129 | } |
no outgoing calls