log: fix level for transfer logs

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-10-03 19:07:07 +02:00
parent 2ecd20d444
commit 6626c8846b
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -205,7 +205,13 @@ func ErrorToConsole(format string, v ...any) {
func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, localAddr, func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, localAddr,
remoteAddr, ftpMode string, err error, remoteAddr, ftpMode string, err error,
) { ) {
ev := logger.Info(). var ev *zerolog.Event
if err != nil {
ev = logger.Error()
} else {
ev = logger.Info()
}
ev.
Timestamp(). Timestamp().
Str("sender", operation). Str("sender", operation).
Str("local_addr", localAddr). Str("local_addr", localAddr).