Skip to content

Commit

Permalink
webrtc: reduce loglevel for pion logs (#2915)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt authored Aug 15, 2024
1 parent fda0eca commit 285123a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions p2p/transport/webrtc/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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...)
}
Expand Down

0 comments on commit 285123a

Please sign in to comment.