Skip to content

Commit 07b9cd2

Browse files
serprexdveeden
andcommitted
feedback
Co-authored-by: Daniël van Eeden <[email protected]>
1 parent 117ac48 commit 07b9cd2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ We pass all tests in https://github.com/bradfitz/go-sql-test using go-mysql driv
490490

491491
## Logging
492492

493-
Logging uses log/slog.
493+
Logging uses [log/slog](https://pkg.go.dev/log/slog) and by default is sent to standard out.
494494

495495
## How to migrate to this repo
496496
To change the used package in your repo it's enough to add this `replace` directive to your `go.mod`:

canal/dump.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (h *dumpParseHandler) Data(db string, table string, values []string) error
5050
e == schema.ErrMissingTableMeta {
5151
return nil
5252
}
53-
h.c.cfg.Logger.Error("error getting table information", slog.String("databse", db), slog.String("table", table), slog.Any("error", err))
53+
h.c.cfg.Logger.Error("error getting table information", slog.String("database", db), slog.String("table", table), slog.Any("error", err))
5454
return errors.Trace(err)
5555
}
5656

@@ -164,7 +164,7 @@ func (c *Canal) dump() error {
164164
if err != nil {
165165
return errors.Trace(err)
166166
}
167-
c.cfg.Logger.Info("skip master data, get current binlog position", slog.Any("pos", pos))
167+
c.cfg.Logger.Info("skip master data, get current binlog position", slog.Any("position", pos))
168168
h.name = pos.Name
169169
h.pos = uint64(pos.Pos)
170170
}

replication/binlogsyncer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ func (b *BinlogSyncer) handleEventAndACK(s *BinlogStreamer, e *BinlogEvent, need
856856
case *RotateEvent:
857857
b.nextPos.Name = string(event.NextLogName)
858858
b.nextPos.Pos = uint32(event.Position)
859-
b.cfg.Logger.Info(fmt.Sprintf("rotate to %s", b.nextPos))
859+
b.cfg.Logger.Info("rotate to next binlog", slog.String("file", b.nextPos.Name), slog.Int("position", b.nextPos))
860860

861861
case *GTIDEvent:
862862
if b.prevGset == nil {

0 commit comments

Comments
 (0)