Improve log formatting with Msgf
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package rtsp
|
package rtsp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -239,8 +238,7 @@ func tcpHandler(conn *rtsp.Conn) {
|
|||||||
|
|
||||||
if err := conn.Accept(); err != nil {
|
if err := conn.Accept(); err != nil {
|
||||||
if err == rtsp.FailedAuth {
|
if err == rtsp.FailedAuth {
|
||||||
rAddr := conn.Connection.RemoteAddr
|
log.Warn().Str("remote_addr", conn.Connection.RemoteAddr).Msg("[rtsp] failed authentication")
|
||||||
log.Warn().Msg(fmt.Sprintf("[rtsp] failed authentication from %s", rAddr))
|
|
||||||
} else if err != io.EOF {
|
} else if err != io.EOF {
|
||||||
log.WithLevel(level).Err(err).Caller().Send()
|
log.WithLevel(level).Err(err).Caller().Send()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user