Improve log formatting with Msgf

This commit is contained in:
Xiaokui Shu
2025-01-08 21:31:37 -05:00
parent 261a936bb8
commit 9e673559c4
+1 -3
View File
@@ -1,7 +1,6 @@
package rtsp
import (
"fmt"
"io"
"net"
"net/url"
@@ -239,8 +238,7 @@ func tcpHandler(conn *rtsp.Conn) {
if err := conn.Accept(); err != nil {
if err == rtsp.FailedAuth {
rAddr := conn.Connection.RemoteAddr
log.Warn().Msg(fmt.Sprintf("[rtsp] failed authentication from %s", rAddr))
log.Warn().Str("remote_addr", conn.Connection.RemoteAddr).Msg("[rtsp] failed authentication")
} else if err != io.EOF {
log.WithLevel(level).Err(err).Caller().Send()
}