Skip to content

Commit 285123a

Browse files
authored
webrtc: reduce loglevel for pion logs (#2915)
1 parent fda0eca commit 285123a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

p2p/transport/webrtc/logger.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var pionLog = logging.Logger("webrtc-transport-pion")
1212

1313
// pionLogger wraps the StandardLogger interface to provide a LeveledLogger interface
1414
// as expected by pion
15+
// Pion logs are too noisy and have invalid log levels. pionLogger downgrades all the
16+
// logs to debug
1517
type pionLogger struct {
1618
logging.StandardLogger
1719
}
@@ -25,20 +27,32 @@ func (l pionLogger) Debug(s string) {
2527
}
2628

2729
func (l pionLogger) Error(s string) {
28-
l.StandardLogger.Error(s)
30+
l.StandardLogger.Debug(s)
31+
}
32+
33+
func (l pionLogger) Errorf(s string, args ...interface{}) {
34+
l.StandardLogger.Debugf(s, args...)
2935
}
3036

3137
func (l pionLogger) Info(s string) {
32-
l.StandardLogger.Info(s)
38+
l.StandardLogger.Debug(s)
39+
}
40+
41+
func (l pionLogger) Infof(s string, args ...interface{}) {
42+
l.StandardLogger.Debugf(s, args...)
3343
}
44+
3445
func (l pionLogger) Warn(s string) {
35-
l.StandardLogger.Warn(s)
46+
l.StandardLogger.Debug(s)
47+
}
48+
49+
func (l pionLogger) Warnf(s string, args ...interface{}) {
50+
l.StandardLogger.Debugf(s, args...)
3651
}
3752

3853
func (l pionLogger) Trace(s string) {
3954
l.StandardLogger.Debug(s)
4055
}
41-
4256
func (l pionLogger) Tracef(s string, args ...interface{}) {
4357
l.StandardLogger.Debugf(s, args...)
4458
}

0 commit comments

Comments
 (0)