From 285123a79793e619400388a875832621dee13c29 Mon Sep 17 00:00:00 2001 From: sukun Date: Thu, 15 Aug 2024 22:26:37 +0530 Subject: [PATCH] webrtc: reduce loglevel for pion logs (#2915) --- p2p/transport/webrtc/logger.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/p2p/transport/webrtc/logger.go b/p2p/transport/webrtc/logger.go index ac9fab7672..ebe5fa309f 100644 --- a/p2p/transport/webrtc/logger.go +++ b/p2p/transport/webrtc/logger.go @@ -12,6 +12,8 @@ var pionLog = logging.Logger("webrtc-transport-pion") // pionLogger wraps the StandardLogger interface to provide a LeveledLogger interface // as expected by pion +// Pion logs are too noisy and have invalid log levels. pionLogger downgrades all the +// logs to debug type pionLogger struct { logging.StandardLogger } @@ -25,20 +27,32 @@ func (l pionLogger) Debug(s string) { } func (l pionLogger) Error(s string) { - l.StandardLogger.Error(s) + l.StandardLogger.Debug(s) +} + +func (l pionLogger) Errorf(s string, args ...interface{}) { + l.StandardLogger.Debugf(s, args...) } func (l pionLogger) Info(s string) { - l.StandardLogger.Info(s) + l.StandardLogger.Debug(s) +} + +func (l pionLogger) Infof(s string, args ...interface{}) { + l.StandardLogger.Debugf(s, args...) } + func (l pionLogger) Warn(s string) { - l.StandardLogger.Warn(s) + l.StandardLogger.Debug(s) +} + +func (l pionLogger) Warnf(s string, args ...interface{}) { + l.StandardLogger.Debugf(s, args...) } func (l pionLogger) Trace(s string) { l.StandardLogger.Debug(s) } - func (l pionLogger) Tracef(s string, args ...interface{}) { l.StandardLogger.Debugf(s, args...) }