Skip to content

Commit 3832ed2

Browse files
serprexdveeden
andcommitted
feedback
Co-authored-by: Daniël van Eeden <[email protected]>
1 parent b3a660b commit 3832ed2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ func (b *BinlogSyncer) handleEventAndACK(s *BinlogStreamer, e *BinlogEvent, need
860860
case *RotateEvent:
861861
b.nextPos.Name = string(event.NextLogName)
862862
b.nextPos.Pos = uint32(event.Position)
863-
b.cfg.Logger.Info(fmt.Sprintf("rotate to %s", b.nextPos))
863+
b.cfg.Logger.Info("rotate to next binlog", slog.String("file", b.nextPos.Name), slog.Int("position", b.nextPos))
864864

865865
case *GTIDEvent:
866866
if b.prevGset == nil {

0 commit comments

Comments
 (0)