diff --git a/cmd/server/main.go b/cmd/server/main.go index e1e3929e4..5939fd663 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -11,10 +11,11 @@ import ( "syscall" "time" + "github.com/livekit/protocol/logger" "github.com/urfave/cli/v2" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" + serverlogger "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/version" @@ -155,9 +156,9 @@ func startServer(c *cli.Context) error { } if conf.Development { - logger.InitDevelopment(conf.LogLevel) + serverlogger.InitDevelopment(conf.LogLevel) } else { - logger.InitProduction(conf.LogLevel) + serverlogger.InitProduction(conf.LogLevel) } if cpuProfile != "" { diff --git a/go.mod b/go.mod index 9c988713a..d1fa5e1e5 100644 --- a/go.mod +++ b/go.mod @@ -7,14 +7,14 @@ require ( github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/gammazero/workerpool v1.1.2 - github.com/go-logr/logr v1.0.0 - github.com/go-logr/zapr v1.0.0 + github.com/go-logr/logr v1.1.0 + github.com/go-logr/zapr v1.1.0 github.com/go-redis/redis/v8 v8.11.3 github.com/google/subcommands v1.2.0 // indirect github.com/google/wire v0.5.0 github.com/gorilla/websocket v1.4.2 github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b - github.com/livekit/protocol v0.8.4 + github.com/livekit/protocol v0.8.6 github.com/magefile/mage v1.11.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 github.com/mitchellh/go-homedir v1.1.0 @@ -39,7 +39,7 @@ require ( github.com/twitchtv/twirp v8.1.0+incompatible github.com/urfave/cli/v2 v2.3.0 github.com/urfave/negroni v1.0.0 - go.uber.org/zap v1.18.1 + go.uber.org/zap v1.19.0 golang.org/x/mod v0.5.0 // indirect golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect golang.org/x/tools v0.1.5 // indirect diff --git a/go.sum b/go.sum index b92a5059f..612bfd487 100644 --- a/go.sum +++ b/go.sum @@ -111,11 +111,11 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.0.0-rc1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.0.0 h1:kH951GinvFVaQgy/ki/B3YYmQtRpExGigSJg6O8z5jo= github.com/go-logr/logr v1.0.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.0.0 h1:rerrgIsgykt8zVvKMVfqxI2SoYvHAFdX11er/SLZZgI= -github.com/go-logr/zapr v1.0.0/go.mod h1:t7rgfcj/l02iFgbQxqhQeoyWA9jX2+2enc4PUHF6Hp0= +github.com/go-logr/logr v1.1.0 h1:nAbevmWlS2Ic4m4+/An5NXkaGqlqpbBgdcuThZxnZyI= +github.com/go-logr/logr v1.1.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/zapr v1.1.0 h1:rZHor2gcVGCG11UlKl+WUsfCMOOi2k/mTCDKDK6zZws= +github.com/go-logr/zapr v1.1.0/go.mod h1:YShqdLLTU346TNVu8Tvwe3bOo6gc75oZ1joeE+1lYdQ= github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCxgt8= github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -246,8 +246,8 @@ github.com/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= github.com/livekit/ion-sfu v1.20.9 h1:Ih+tE5CXqdL1o6iXfZn+uBoddBXWceaOKVIun6aVuZM= github.com/livekit/ion-sfu v1.20.9/go.mod h1:g8hwobZI5fvX1RXvayf4ZXkgP7spV5YGE4yTSsumpB4= -github.com/livekit/protocol v0.8.4 h1:XoH+DLno8EpT+xWor+NAVhVgmYIN+P1BV5um/nFCZAc= -github.com/livekit/protocol v0.8.4/go.mod h1:D+NoXVPVu5VRqxGe0Lt3Q1gvTm6cSRzTbYhFbRz84h8= +github.com/livekit/protocol v0.8.6 h1:pNdxWrXFXNvxF5wzsmKiiIYyrwt13dUmZiUQ4awjOEM= +github.com/livekit/protocol v0.8.6/go.mod h1:0LxJXnPRSQ05umVz1NnvRjNWNZct4fsT1OKpIUkukO0= github.com/lucsky/cuid v1.0.2 h1:z4XlExeoderxoPj2/dxKOyPxe9RCOu7yNq9/XWxIUMQ= github.com/lucsky/cuid v1.0.2/go.mod h1:QaaJqckboimOmhRSJXSx/+IT+VTfxfPGSo/6mfgUfmE= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -491,11 +491,10 @@ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+ go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/pkg/config/ip.go b/pkg/config/ip.go index a76b7e337..e0a1b4c6b 100644 --- a/pkg/config/ip.go +++ b/pkg/config/ip.go @@ -6,7 +6,7 @@ import ( "net" "time" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/protocol/logger" "github.com/pion/stun" "github.com/pkg/errors" ) diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go index 3f6c92027..86e353311 100644 --- a/pkg/logger/logger.go +++ b/pkg/logger/logger.go @@ -1,8 +1,8 @@ -package logger +package serverlogger import ( - "github.com/go-logr/logr" "github.com/go-logr/zapr" + "github.com/livekit/protocol/logger" "github.com/pion/ion-sfu/pkg/buffer" "github.com/pion/ion-sfu/pkg/sfu" "github.com/pion/logging" @@ -11,28 +11,10 @@ import ( ) var ( - // pion/ion-sfu - defaultLogger = logr.Discard() // pion/webrtc, pion/turn defaultFactory logging.LoggerFactory ) -// Note: already with extra depth 1 -func GetLogger() logr.Logger { - if defaultLogger == logr.Discard() { - InitDevelopment("") - } - return defaultLogger -} - -// Note: only pass in logr.Logger with default depth -func SetLogger(l logr.Logger) { - sfu.Logger = l.WithName("sfu") - buffer.Logger = sfu.Logger - - defaultLogger = l.WithCallDepth(1).WithName("livekit") -} - func LoggerFactory() logging.LoggerFactory { if defaultFactory == nil { defaultFactory = logging.NewDefaultLoggerFactory() @@ -44,6 +26,14 @@ func SetLoggerFactory(lf logging.LoggerFactory) { defaultFactory = lf } +func InitProduction(logLevel string) { + initLogger(zap.NewProductionConfig(), logLevel) +} + +func InitDevelopment(logLevel string) { + initLogger(zap.NewDevelopmentConfig(), logLevel) +} + // valid levels: debug, info, warn, error, fatal, panic func initLogger(config zap.Config, level string) { if level != "" { @@ -53,33 +43,9 @@ func initLogger(config zap.Config, level string) { } } - logger, _ := config.Build() - SetLogger(zapr.NewLogger(logger)) -} - -func InitProduction(logLevel string) { - initLogger(zap.NewProductionConfig(), logLevel) -} - -func InitDevelopment(logLevel string) { - initLogger(zap.NewDevelopmentConfig(), logLevel) -} - -func Debugw(msg string, keysAndValues ...interface{}) { - defaultLogger.V(1).Info(msg, keysAndValues...) -} - -func Infow(msg string, keysAndValues ...interface{}) { - defaultLogger.Info(msg, keysAndValues...) -} - -func Warnw(msg string, err error, keysAndValues ...interface{}) { - if err != nil { - keysAndValues = append([]interface{}{"error", err}, keysAndValues...) - } - defaultLogger.Info(msg, keysAndValues...) -} - -func Errorw(msg string, err error, keysAndValues ...interface{}) { - defaultLogger.Error(err, msg, keysAndValues...) + l, _ := config.Build() + zapLogger := zapr.NewLogger(l) + sfu.Logger = zapLogger.WithName("sfu") + buffer.Logger = sfu.Logger + logger.SetLogger(zapLogger, "livekit") } diff --git a/pkg/routing/localrouter.go b/pkg/routing/localrouter.go index 93639b55c..ed29f93fc 100644 --- a/pkg/routing/localrouter.go +++ b/pkg/routing/localrouter.go @@ -5,11 +5,10 @@ import ( "sync" "time" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" - - "github.com/livekit/livekit-server/pkg/logger" ) // a router of messages on the same node, basic implementation for local testing diff --git a/pkg/routing/redisrouter.go b/pkg/routing/redisrouter.go index e666d43a6..72a78e192 100644 --- a/pkg/routing/redisrouter.go +++ b/pkg/routing/redisrouter.go @@ -5,12 +5,12 @@ import ( "time" "github.com/go-redis/redis/v8" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pkg/errors" "google.golang.org/protobuf/proto" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/utils/stats" ) diff --git a/pkg/rtc/config.go b/pkg/rtc/config.go index 097cabb66..64b08cbf3 100644 --- a/pkg/rtc/config.go +++ b/pkg/rtc/config.go @@ -9,7 +9,7 @@ import ( "github.com/pion/webrtc/v3" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" + serverlogger "github.com/livekit/livekit-server/pkg/logger" ) const ( @@ -41,7 +41,7 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err SDPSemantics: webrtc.SDPSemanticsUnifiedPlan, } s := webrtc.SettingEngine{ - LoggerFactory: logger.LoggerFactory(), + LoggerFactory: serverlogger.LoggerFactory(), } if externalIP != "" { diff --git a/pkg/rtc/mediatrack.go b/pkg/rtc/mediatrack.go index ef29bae0b..ffff79bf0 100644 --- a/pkg/rtc/mediatrack.go +++ b/pkg/rtc/mediatrack.go @@ -6,6 +6,7 @@ import ( "sync/atomic" "time" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/buffer" @@ -16,7 +17,6 @@ import ( "github.com/pion/webrtc/v3/pkg/rtcerr" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" ) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index fd9fea1d4..449da22c4 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -7,6 +7,7 @@ import ( "sync/atomic" "time" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/sfu" @@ -17,7 +18,6 @@ import ( "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index d4c6c187f..74044cf5d 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -7,13 +7,13 @@ import ( "sync/atomic" "time" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/buffer" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" ) diff --git a/pkg/rtc/room_test.go b/pkg/rtc/room_test.go index 365a430e7..273b99045 100644 --- a/pkg/rtc/room_test.go +++ b/pkg/rtc/room_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" + serverlogger "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/rtc/types/typesfakes" @@ -23,7 +23,7 @@ const ( ) func init() { - logger.InitDevelopment("") + serverlogger.InitDevelopment("") } func TestJoinedState(t *testing.T) { diff --git a/pkg/rtc/rtc_unix.go b/pkg/rtc/rtc_unix.go index 75d2ceb36..3b357a21f 100644 --- a/pkg/rtc/rtc_unix.go +++ b/pkg/rtc/rtc_unix.go @@ -7,7 +7,7 @@ import ( "net" "syscall" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/protocol/logger" ) func checkUDPReadBuffer() { diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index 4889c5a5f..2f09d3141 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -5,11 +5,11 @@ import ( "time" "github.com/bep/debounce" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/pion/interceptor" "github.com/pion/webrtc/v3" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/utils/stats" ) diff --git a/pkg/rtc/utils.go b/pkg/rtc/utils.go index 447e9affc..f9079df15 100644 --- a/pkg/rtc/utils.go +++ b/pkg/rtc/utils.go @@ -6,10 +6,10 @@ import ( "io" "strings" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/pion/webrtc/v3" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" ) diff --git a/pkg/service/roommanager.go b/pkg/service/roommanager.go index 9901af807..2d23eedd8 100644 --- a/pkg/service/roommanager.go +++ b/pkg/service/roommanager.go @@ -7,12 +7,12 @@ import ( "time" "github.com/gammazero/workerpool" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" diff --git a/pkg/service/rtcservice.go b/pkg/service/rtcservice.go index e5b4d726e..250b090f9 100644 --- a/pkg/service/rtcservice.go +++ b/pkg/service/rtcservice.go @@ -8,10 +8,10 @@ import ( "strings" "github.com/gorilla/websocket" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" diff --git a/pkg/service/server.go b/pkg/service/server.go index b40f01c78..25720e9b0 100644 --- a/pkg/service/server.go +++ b/pkg/service/server.go @@ -11,6 +11,7 @@ import ( "time" "github.com/livekit/protocol/auth" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/turn/v2" @@ -18,7 +19,6 @@ import ( "github.com/urfave/negroni" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/version" ) diff --git a/pkg/service/turn.go b/pkg/service/turn.go index 9e7384d5b..f5b88aeb8 100644 --- a/pkg/service/turn.go +++ b/pkg/service/turn.go @@ -6,11 +6,12 @@ import ( "net" "strconv" + "github.com/livekit/protocol/logger" "github.com/pion/turn/v2" "github.com/pkg/errors" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" + serverlogger "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" ) @@ -34,7 +35,7 @@ func NewTurnServer(conf *config.Config, roomStore RoomStore, node routing.LocalN serverConfig := turn.ServerConfig{ Realm: livekitRealm, AuthHandler: newTurnAuthHandler(roomStore), - LoggerFactory: logger.LoggerFactory(), + LoggerFactory: serverlogger.LoggerFactory(), } relayAddrGen := &turn.RelayAddressGeneratorPortRange{ RelayAddress: net.ParseIP(node.Ip), diff --git a/pkg/service/utils.go b/pkg/service/utils.go index a3577bfaf..13ede9ae6 100644 --- a/pkg/service/utils.go +++ b/pkg/service/utils.go @@ -10,13 +10,13 @@ import ( "github.com/go-redis/redis/v8" "github.com/google/wire" "github.com/livekit/protocol/auth" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" "github.com/pkg/errors" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" ) diff --git a/pkg/service/wsprotocol.go b/pkg/service/wsprotocol.go index ebf524887..04349f2d0 100644 --- a/pkg/service/wsprotocol.go +++ b/pkg/service/wsprotocol.go @@ -5,11 +5,11 @@ import ( "time" "github.com/gorilla/websocket" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" ) diff --git a/pkg/testutils/timeout.go b/pkg/testutils/timeout.go index dba3d71e4..89eff6d08 100644 --- a/pkg/testutils/timeout.go +++ b/pkg/testutils/timeout.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/protocol/logger" ) var ( diff --git a/test/client/client.go b/test/client/client.go index 363ee4187..5720dca58 100644 --- a/test/client/client.go +++ b/test/client/client.go @@ -21,7 +21,8 @@ import ( "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/protocol/logger" + "github.com/livekit/livekit-server/pkg/rtc" ) diff --git a/test/client/trackwriter.go b/test/client/trackwriter.go index 865421f6f..9694b7b49 100644 --- a/test/client/trackwriter.go +++ b/test/client/trackwriter.go @@ -12,7 +12,7 @@ import ( "github.com/pion/webrtc/v3/pkg/media/ivfreader" "github.com/pion/webrtc/v3/pkg/media/oggreader" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/protocol/logger" ) // Writes a file to an RTP track. diff --git a/test/integration_helpers.go b/test/integration_helpers.go index ee6dbc51d..5c42883b7 100644 --- a/test/integration_helpers.go +++ b/test/integration_helpers.go @@ -10,12 +10,13 @@ import ( "github.com/go-redis/redis/v8" "github.com/livekit/protocol/auth" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/twitchtv/twirp" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" + serverlogger "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/testutils" @@ -42,7 +43,7 @@ var ( ) func init() { - logger.InitDevelopment("") + serverlogger.InitDevelopment("") } func setupSingleNodeTest(name string, roomName string) (*service.LivekitServer, func()) { diff --git a/test/scenarios.go b/test/scenarios.go index bf20b5ef7..dd79a9cd9 100644 --- a/test/scenarios.go +++ b/test/scenarios.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/livekit/livekit-server/pkg/testutils" - testclient "github.com/livekit/livekit-server/test/client" + "github.com/livekit/protocol/logger" "github.com/stretchr/testify/require" - "github.com/livekit/livekit-server/pkg/logger" + "github.com/livekit/livekit-server/pkg/testutils" + testclient "github.com/livekit/livekit-server/test/client" ) // a scenario with lots of clients connecting, publishing, and leaving at random periods diff --git a/test/webhook_test.go b/test/webhook_test.go index 17489f00e..fa4baf0b5 100644 --- a/test/webhook_test.go +++ b/test/webhook_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/livekit/protocol/auth" + "github.com/livekit/protocol/logger" livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" @@ -16,7 +17,6 @@ import ( "google.golang.org/protobuf/encoding/protojson" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/testutils"