Adopt pion logging initialization moving to protocol (#1667)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user