Skip to content

Commit

Permalink
log: fix level for transfer logs
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Oct 3, 2024
1 parent c9d4920 commit e1008c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ func ErrorToConsole(format string, v ...any) {
func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, localAddr,
remoteAddr, ftpMode string, err error,
) {
ev := logger.Info().
var ev *zerolog.Event
if err != nil {
ev = logger.Error()
} else {
ev = logger.Info()
}
ev.
Timestamp().
Str("sender", operation).
Str("local_addr", localAddr).
Expand Down

0 comments on commit e1008c3

Please sign in to comment.