Adopt pion logging initialization moving to protocol (#1667)

This commit is contained in:
Benjamin Pracht
2023-04-28 10:51:41 -07:00
committed by GitHub
parent 1148d38978
commit a08cd23b6d
11 changed files with 25 additions and 201 deletions
+11
View File
@@ -14,6 +14,7 @@ import (
"gopkg.in/yaml.v3"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/logger/pionlogger"
redisLiveKit "github.com/livekit/protocol/redis"
)
@@ -744,3 +745,13 @@ func (conf *Config) unmarshalKeys(keys string) error {
}
return nil
}
// Note: only pass in logr.Logger with default depth
func SetLogger(l logger.Logger) {
logger.SetLogger(l, "livekit")
}
func InitLoggerFromConfig(config LoggingConfig) {
pionlogger.SetLogLevel(config.PionLevel)
logger.InitFromConfig(config.Config, "livekit")
}