Skip to content

Commit

Permalink
code health: unify log messages format
Browse files Browse the repository at this point in the history
The patch removes a last newline character from log messages because
the character will be added anyway [1][2].

1. https://pkg.go.dev/log#Logger.Printf
2. https://pkg.go.dev/log#Output

Part of #119
  • Loading branch information
oleg-jukovec committed Dec 7, 2022
1 parent 525b294 commit a78709d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ func (d defaultLogger) Report(event ConnLogKind, conn *Connection, v ...interfac
case LogReconnectFailed:
reconnects := v[0].(uint)
err := v[1].(error)
log.Printf("tarantool: reconnect (%d/%d) to %s failed: %s\n", reconnects, conn.opts.MaxReconnects, conn.addr, err.Error())
log.Printf("tarantool: reconnect (%d/%d) to %s failed: %s", reconnects, conn.opts.MaxReconnects, conn.addr, err)
case LogLastReconnectFailed:
err := v[0].(error)
log.Printf("tarantool: last reconnect to %s failed: %s, giving it up.\n", conn.addr, err.Error())
log.Printf("tarantool: last reconnect to %s failed: %s, giving it up", conn.addr, err)
case LogUnexpectedResultId:
resp := v[0].(*Response)
log.Printf("tarantool: connection %s got unexpected resultId (%d) in response", conn.addr, resp.RequestId)
Expand Down

0 comments on commit a78709d

Please sign in to comment.