Update to new logging library, using sampling participant logger (#1219)

This commit is contained in:
David Zhao
2022-12-09 00:09:03 -08:00
committed by GitHub
parent 57ce032cfe
commit 7a1273151f
23 changed files with 81 additions and 78 deletions
+2 -3
View File
@@ -10,7 +10,6 @@ require (
github.com/florianl/go-tc v0.4.1
github.com/gammazero/deque v0.1.0
github.com/gammazero/workerpool v1.1.2
github.com/go-logr/logr v1.2.3
github.com/go-redis/redis/v8 v8.11.5
github.com/google/wire v0.5.0
github.com/gorilla/websocket v1.5.0
@@ -18,7 +17,7 @@ require (
github.com/hashicorp/golang-lru v0.6.0
github.com/livekit/mageutil v0.0.0-20221002073820-d9198083cfdc
github.com/livekit/mediatransportutil v0.0.0-20221007030528-7440725c362b
github.com/livekit/protocol v1.2.5-0.20221208020623-5420927b7944
github.com/livekit/protocol v1.3.0
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995
github.com/mackerelio/go-osstat v0.2.3
github.com/magefile/mage v1.14.0
@@ -61,7 +60,7 @@ require (
github.com/eapache/channels v1.1.0 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/frostbyte73/go-throttle v0.0.0-20210621200530-8018c891361d // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/subcommands v1.2.0 // indirect
+2 -3
View File
@@ -118,7 +118,6 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
@@ -246,8 +245,8 @@ github.com/livekit/mageutil v0.0.0-20221002073820-d9198083cfdc h1:e3GIA9AL6h4a38
github.com/livekit/mageutil v0.0.0-20221002073820-d9198083cfdc/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20221007030528-7440725c362b h1:RBNV8TckETSkIkKxcD12d8nZKVkB9GSY/sQlMoaruP4=
github.com/livekit/mediatransportutil v0.0.0-20221007030528-7440725c362b/go.mod h1:1Dlx20JPoIKGP45eo+yuj0HjeE25zmyeX/EWHiPCjFw=
github.com/livekit/protocol v1.2.5-0.20221208020623-5420927b7944 h1:k7ULz4YXa7Bb+2hAzEp4/Wo5pEBazaTaFfnwBRLPLt0=
github.com/livekit/protocol v1.2.5-0.20221208020623-5420927b7944/go.mod h1:87MLIMbKaZs0SbDebMw1b7n/gD5utwEDq3zIRYcHJHA=
github.com/livekit/protocol v1.3.0 h1:9rzcKrLxZQIsL5Us2ZARmAkTw1dZJMF3WJoS6MCZUIw=
github.com/livekit/protocol v1.3.0/go.mod h1:87MLIMbKaZs0SbDebMw1b7n/gD5utwEDq3zIRYcHJHA=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995 h1:vOaY2qvfLihDyeZtnGGN1Law9wRrw8BMGCr1TygTvMw=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995/go.mod h1:116ych8UaEs9vfIE8n6iZCZ30iagUFTls0vRmC+Ix5U=
github.com/mackerelio/go-osstat v0.2.3 h1:jAMXD5erlDE39kdX2CU7YwCGRcxIO33u/p8+Fhe5dJw=
+18 -10
View File
@@ -4,13 +4,14 @@ import (
"fmt"
"strings"
"github.com/go-logr/logr"
"go.uber.org/zap/zapcore"
"github.com/livekit/protocol/logger"
)
// implements webrtc.LeveledLogger
type logAdapter struct {
logger logr.Logger
logger logger.Logger
level zapcore.Level
ignoredPrefixes []string
}
@@ -27,14 +28,21 @@ func (l *logAdapter) Debug(msg string) {
if l.level > zapcore.DebugLevel {
return
}
l.logger.V(1).Info(msg)
if l.shouldIgnore(msg) {
return
}
l.logger.Debugw(msg)
}
func (l *logAdapter) Debugf(format string, args ...interface{}) {
if l.level > zapcore.DebugLevel {
return
}
l.logger.V(1).Info(fmt.Sprintf(format, args...))
msg := fmt.Sprintf(format, args...)
if l.shouldIgnore(msg) {
return
}
l.logger.Debugw(msg)
}
func (l *logAdapter) Info(msg string) {
@@ -44,7 +52,7 @@ func (l *logAdapter) Info(msg string) {
if l.shouldIgnore(msg) {
return
}
l.logger.Info(msg)
l.logger.Infow(msg)
}
func (l *logAdapter) Infof(format string, args ...interface{}) {
@@ -55,7 +63,7 @@ func (l *logAdapter) Infof(format string, args ...interface{}) {
if l.shouldIgnore(msg) {
return
}
l.logger.Info(msg)
l.logger.Infow(msg)
}
func (l *logAdapter) Warn(msg string) {
@@ -65,7 +73,7 @@ func (l *logAdapter) Warn(msg string) {
if l.shouldIgnore(msg) {
return
}
l.logger.V(-1).Info(msg)
l.logger.Warnw(msg, nil)
}
func (l *logAdapter) Warnf(format string, args ...interface{}) {
@@ -76,7 +84,7 @@ func (l *logAdapter) Warnf(format string, args ...interface{}) {
if l.shouldIgnore(msg) {
return
}
l.logger.V(-1).Info(msg)
l.logger.Warnw(msg, nil)
}
func (l *logAdapter) Error(msg string) {
@@ -86,7 +94,7 @@ func (l *logAdapter) Error(msg string) {
if l.shouldIgnore(msg) {
return
}
l.logger.Error(nil, msg)
l.logger.Errorw(msg, nil)
}
func (l *logAdapter) Errorf(format string, args ...interface{}) {
@@ -97,7 +105,7 @@ func (l *logAdapter) Errorf(format string, args ...interface{}) {
if l.shouldIgnore(msg) {
return
}
l.logger.Error(nil, msg)
l.logger.Errorw(msg, nil)
}
func (l *logAdapter) shouldIgnore(msg string) bool {
+3 -7
View File
@@ -1,7 +1,6 @@
package serverlogger
import (
"github.com/go-logr/logr"
"github.com/pion/logging"
"go.uber.org/zap/zapcore"
@@ -35,13 +34,10 @@ var (
// implements webrtc.LoggerFactory
type LoggerFactory struct {
logger logr.Logger
logger logger.Logger
}
func NewLoggerFactory(logger logr.Logger) *LoggerFactory {
if logger.GetSink() == nil {
logger = logr.Discard()
}
func NewLoggerFactory(logger logger.Logger) *LoggerFactory {
return &LoggerFactory{
logger: logger,
}
@@ -56,7 +52,7 @@ func (f *LoggerFactory) NewLogger(scope string) logging.LeveledLogger {
}
// Note: only pass in logr.Logger with default depth
func SetLogger(l logr.Logger) {
func SetLogger(l logger.Logger) {
logger.SetLogger(l, "livekit")
}
+4 -4
View File
@@ -5,6 +5,7 @@ import (
"time"
"github.com/bep/debounce"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
@@ -35,6 +36,9 @@ type DynacastManager struct {
}
func NewDynacastManager(params DynacastManagerParams) *DynacastManager {
if params.Logger == nil {
params.Logger = logger.GetLogger()
}
d := &DynacastManager{
params: params,
dynacastQuality: make(map[string]*DynacastQuality),
@@ -84,22 +88,18 @@ func (d *DynacastManager) Close() {
}
}
//
// THere are situations like track unmute or streaming from a sifferent node
// where subscribed quality needs to sent to the provider immediately.
// This bypasses any debouncing and forces a subscribed quality update
// with immediate effect.
//
func (d *DynacastManager) ForceUpdate() {
d.update(true)
}
//
// It is possible for tracks to be in pending close state. When track
// is waiting to be closed, a node is not streaming a track. This can
// be used to force an update announcing that subscribed quality is OFF,
// i.e. indicating not pulling track any more.
//
func (d *DynacastManager) ForceQuality(quality livekit.VideoQuality) {
d.lock.Lock()
defer d.lock.Unlock()
+4 -1
View File
@@ -12,6 +12,7 @@ import (
"github.com/livekit/protocol/auth"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/config"
@@ -467,8 +468,9 @@ func newParticipantForTestWithOpts(identity livekit.ParticipantIdentity, opts *p
FmtpLine: c.FmtpLine,
})
}
sid := livekit.ParticipantID(utils.NewGuid(utils.ParticipantPrefix))
p, _ := NewParticipant(ParticipantParams{
SID: livekit.ParticipantID(utils.NewGuid(utils.ParticipantPrefix)),
SID: sid,
Identity: identity,
Config: rtcConf,
Sink: &routingfakes.FakeMessageSink{},
@@ -478,6 +480,7 @@ func newParticipantForTestWithOpts(identity livekit.ParticipantIdentity, opts *p
EnabledCodecs: enabledCodecs,
ClientConf: opts.clientConf,
ClientInfo: ClientInfo{ClientInfo: opts.clientInfo},
Logger: LoggerWithParticipant(logger.GetLogger(), identity, sid, false),
})
p.isPublisher.Store(opts.publisher)
+1 -1
View File
@@ -85,7 +85,7 @@ func NewRoom(
r := &Room{
protoRoom: proto.Clone(room).(*livekit.Room),
internal: internal,
Logger: LoggerWithRoom(logger.GetDefaultLogger(), livekit.RoomName(room.Name), livekit.RoomID(room.Sid)),
Logger: LoggerWithRoom(logger.GetLogger(), livekit.RoomName(room.Name), livekit.RoomID(room.Sid)),
config: config,
audioConfig: audioConfig,
telemetry: telemetry,
+4 -2
View File
@@ -7,7 +7,6 @@ import (
"time"
"github.com/bep/debounce"
"github.com/go-logr/logr"
"github.com/pion/ice/v2"
"github.com/pion/interceptor"
"github.com/pion/interceptor/pkg/cc"
@@ -257,7 +256,7 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
se.SetICETimeouts(iceDisconnectedTimeout, iceFailedTimeout, iceKeepaliveInterval)
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger))
lf := serverlogger.NewLoggerFactory(params.Logger)
if lf != nil {
se.LoggerFactory = lf
}
@@ -318,6 +317,9 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
}
func NewPCTransport(params TransportParams) (*PCTransport, error) {
if params.Logger == nil {
params.Logger = logger.GetLogger()
}
t := &PCTransport{
params: params,
debouncedNegotiate: debounce.New(negotiationFrequency),
+3
View File
@@ -76,6 +76,9 @@ type TransportManager struct {
}
func NewTransportManager(params TransportManagerParams) (*TransportManager, error) {
if params.Logger == nil {
params.Logger = logger.GetLogger()
}
t := &TransportManager{
params: params,
mediaLossProxy: NewMediaLossProxy(MediaLossProxyParams{Logger: params.Logger}),
+8 -3
View File
@@ -6,14 +6,19 @@ import (
"github.com/stretchr/testify/require"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
)
var defaultUptrackManagerParams = UpTrackManagerParams{
Logger: logger.GetLogger(),
}
func TestUpdateSubscriptionPermission(t *testing.T) {
t.Run("updates subscription permission", func(t *testing.T) {
um := NewUpTrackManager(UpTrackManagerParams{})
um := NewUpTrackManager(defaultUptrackManagerParams)
tra := &typesfakes.FakeMediaTrack{}
tra.IDReturns("audio")
@@ -103,7 +108,7 @@ func TestUpdateSubscriptionPermission(t *testing.T) {
})
t.Run("updates subscription permission using both", func(t *testing.T) {
um := NewUpTrackManager(UpTrackManagerParams{})
um := NewUpTrackManager(defaultUptrackManagerParams)
tra := &typesfakes.FakeMediaTrack{}
tra.IDReturns("audio")
@@ -176,7 +181,7 @@ func TestUpdateSubscriptionPermission(t *testing.T) {
func TestSubscriptionPermission(t *testing.T) {
t.Run("checks subscription permission", func(t *testing.T) {
um := NewUpTrackManager(UpTrackManagerParams{})
um := NewUpTrackManager(defaultUptrackManagerParams)
tra := &typesfakes.FakeMediaTrack{}
tra.IDReturns("audio")
+15 -24
View File
@@ -6,7 +6,6 @@ import (
"io"
"strings"
"github.com/go-logr/logr"
"github.com/pion/webrtc/v3"
"github.com/livekit/protocol/livekit"
@@ -130,51 +129,43 @@ func Recover() {
// logger helpers
func LoggerWithParticipant(l logger.Logger, identity livekit.ParticipantIdentity, sid livekit.ParticipantID, isRemote bool) logger.Logger {
lr := logr.Logger(l)
values := make([]interface{}, 0, 4)
if identity != "" {
lr = lr.WithValues("participant", identity)
values = append(values, "participant", identity)
}
if sid != "" {
lr = lr.WithValues("pID", sid)
values = append(values, "pID", sid)
}
lr = lr.WithValues("remote", isRemote)
return logger.Logger(lr)
values = append(values, "remote", isRemote)
// enable sampling per participant
return l.WithItemSampler().WithValues(values...)
}
func LoggerWithRoom(l logger.Logger, name livekit.RoomName, roomID livekit.RoomID) logger.Logger {
lr := logr.Logger(l)
values := make([]interface{}, 0, 2)
if name != "" {
lr = lr.WithValues("room", name)
values = append(values, "room", name)
}
if roomID != "" {
lr = lr.WithValues("roomID", roomID)
values = append(values, "roomID", roomID)
}
return logger.Logger(lr)
return l.WithValues(values...)
}
func LoggerWithTrack(l logger.Logger, trackID livekit.TrackID, isRelayed bool) logger.Logger {
lr := logr.Logger(l)
if trackID != "" {
lr = lr.WithValues("trackID", trackID)
lr = lr.WithValues("relayed", isRelayed)
return l.WithValues("trackID", trackID, "relayed", isRelayed)
}
return logger.Logger(lr)
return l
}
func LoggerWithPCTarget(l logger.Logger, target livekit.SignalTarget) logger.Logger {
lr := logr.Logger(l)
if lr.GetSink() == nil {
return l
}
lr = lr.WithValues("transport", target)
return logger.Logger(lr)
return l.WithValues("transport", target)
}
func LoggerWithCodecMime(l logger.Logger, mime string) logger.Logger {
lr := logr.Logger(l)
if mime != "" {
lr = lr.WithValues("mime", mime)
return l.WithValues("mime", mime)
}
return logger.Logger(lr)
return l
}
+2 -2
View File
@@ -461,7 +461,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.LocalPa
defer rtc.Recover()
pLogger := rtc.LoggerWithParticipant(
rtc.LoggerWithRoom(logger.GetDefaultLogger(), room.Name(), room.ID()),
rtc.LoggerWithRoom(logger.GetLogger(), room.Name(), room.ID()),
participant.Identity(),
participant.ID(),
false,
@@ -529,7 +529,7 @@ func (r *RoomManager) handleRTCMessage(ctx context.Context, roomName livekit.Roo
sid = participant.ID()
}
pLogger := rtc.LoggerWithParticipant(
rtc.LoggerWithRoom(logger.GetDefaultLogger(), roomName, room.ID()),
rtc.LoggerWithRoom(logger.GetLogger(), roomName, room.ID()),
identity,
sid,
false,
+1 -1
View File
@@ -224,7 +224,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
pLogger := rtc.LoggerWithParticipant(
rtc.LoggerWithRoom(logger.GetDefaultLogger(), roomName, livekit.RoomID(rm.Sid)),
rtc.LoggerWithRoom(logger.GetLogger(), roomName, livekit.RoomID(rm.Sid)),
pi.Identity,
pi.ID,
false,
+1 -1
View File
@@ -83,7 +83,7 @@ func NewLivekitServer(conf *config.Config,
middlewares = append(middlewares, NewAPIKeyAuthMiddleware(keyProvider))
}
twirpLoggingHook := TwirpLogger(logger.GetDefaultLogger())
twirpLoggingHook := TwirpLogger(logger.GetLogger())
roomServer := livekit.NewRoomServiceServer(roomService, twirpLoggingHook)
egressServer := livekit.NewEgressServer(egressService, twirpLoggingHook)
ingressServer := livekit.NewIngressServer(ingressService, twirpLoggingHook)
+1 -1
View File
@@ -101,7 +101,7 @@ type Buffer struct {
// NewBuffer constructs a new Buffer
func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer {
l := logger.GetDefaultLogger() // will be reset with correct context via SetLogger
l := logger.GetLogger() // will be reset with correct context via SetLogger
b := &Buffer{
mediaSSRC: ssrc,
videoPool: vp,
+4 -4
View File
@@ -150,7 +150,7 @@ func TestFpsVP8(t *testing.T) {
frames := [][]*testFrameInfo{}
vp8calcs := make([]*FrameRateCalculatorVP8, len(fps))
for i := range vp8calcs {
vp8calcs[i] = NewFrameRateCalculatorVP8(90000, logger.Logger{})
vp8calcs[i] = NewFrameRateCalculatorVP8(90000, logger.GetLogger())
frames = append(frames, createFrames(c.startFrameNumber, c.startTs, 200, [][]float32{fps[i]}, false)[0])
}
@@ -181,7 +181,7 @@ func TestFpsVP8(t *testing.T) {
frames := [][]*testFrameInfo{}
vp8calcs := make([]*FrameRateCalculatorVP8, len(fps))
for i := range vp8calcs {
vp8calcs[i] = NewFrameRateCalculatorVP8(90000, logger.Logger{})
vp8calcs[i] = NewFrameRateCalculatorVP8(90000, logger.GetLogger())
frames = append(frames, createFrames(100, 12345678, 300, [][]float32{fps[i]}, false)[0])
for j := 5; j < 130; j++ {
if j%2 == 0 {
@@ -240,7 +240,7 @@ func TestFpsDD(t *testing.T) {
t.Run(name, func(t *testing.T) {
fps := testCase.fps
frames := createFrames(c.startFrameNumber, c.startTs, 500, fps, testCase.spatialDependency)
ddcalc := NewFrameRateCalculatorDD(90000, logger.Logger{})
ddcalc := NewFrameRateCalculatorDD(90000, logger.GetLogger())
ddcalc.SetMaxLayer(int32(len(fps)-1), int32(len(fps[0])-1))
ddcalcs := make([]FrameRateCalculator, len(fps))
for i := range fps {
@@ -273,7 +273,7 @@ func TestFpsDD(t *testing.T) {
t.Run("packet lost and duplicate", func(t *testing.T) {
fps := [][]float32{{7.5, 15, 30}, {7.5, 15, 30}, {7.5, 15, 30}}
frames := createFrames(100, 12345678, 500, fps, true)
ddcalc := NewFrameRateCalculatorDD(90000, logger.Logger{})
ddcalc := NewFrameRateCalculatorDD(90000, logger.GetLogger())
ddcalc.SetMaxLayer(int32(len(fps)-1), int32(len(fps[0])-1))
ddcalcs := make([]FrameRateCalculator, len(fps))
for i := range fps {
+1 -1
View File
@@ -18,7 +18,7 @@ func disable(f *Forwarder) {
}
func newForwarder(codec webrtc.RTPCodecCapability, kind webrtc.RTPCodecType) *Forwarder {
f := NewForwarder(kind, logger.GetDefaultLogger())
f := NewForwarder(kind, logger.GetLogger())
f.DetermineCodec(codec)
return f
}
+1 -2
View File
@@ -7,7 +7,6 @@ import (
"sync"
"time"
"github.com/go-logr/logr"
"github.com/pion/rtcp"
"github.com/pion/webrtc/v3"
"go.uber.org/atomic"
@@ -301,7 +300,7 @@ func (w *WebRTCReceiver) AddUpTrack(track *webrtc.TrackRemote, buff *buffer.Buff
if w.Kind() == webrtc.RTPCodecTypeVideo {
layer = buffer.RidToSpatialLayer(track.RID(), w.trackInfo)
}
buff.SetLogger(logger.Logger(logr.Logger(w.logger).WithValues("layer", layer)))
buff.SetLogger(w.logger.WithValues("layer", layer))
buff.SetTWCC(w.twcc)
buff.SetAudioLevelParams(audio.AudioLevelParams{
ActiveLevel: w.audioConfig.ActiveLevel,
+1 -1
View File
@@ -11,7 +11,7 @@ import (
)
func newRTPMunger() *RTPMunger {
return NewRTPMunger(logger.GetDefaultLogger())
return NewRTPMunger(logger.GetLogger())
}
func TestSetLastSnTs(t *testing.T) {
+2 -2
View File
@@ -13,7 +13,7 @@ import (
)
func Test_sequencer(t *testing.T) {
seq := newSequencer(500, 0, logger.GetDefaultLogger())
seq := newSequencer(500, 0, logger.GetLogger())
off := uint16(15)
for i := uint16(1); i < 518; i++ {
@@ -84,7 +84,7 @@ func Test_sequencer_getNACKSeqNo(t *testing.T) {
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
n := newSequencer(5, 10, logger.GetDefaultLogger())
n := newSequencer(5, 10, logger.GetLogger())
for _, i := range tt.fields.input {
n.push(i, i+tt.fields.offset, 123, 3)
+1 -1
View File
@@ -19,7 +19,7 @@ func newStreamTracker(samplesRequired uint32, cyclesRequired uint32, cycleDurati
CyclesRequired: cyclesRequired,
CycleDuration: cycleDuration,
BitrateReportInterval: 1 * time.Second,
Logger: logger.GetDefaultLogger(),
Logger: logger.GetLogger(),
})
}
+1 -3
View File
@@ -5,8 +5,6 @@ import (
"sync"
"time"
"github.com/go-logr/logr"
"github.com/livekit/livekit-server/pkg/sfu/buffer"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
@@ -128,7 +126,7 @@ func (s *StreamTrackerManager) AddTracker(layer int32) *StreamTracker {
params = ConfigVideo[layer]
}
params.Logger = logger.Logger(logr.Logger(s.logger).WithValues("layer", layer))
params.Logger = s.logger.WithValues("layer", layer)
tracker := NewStreamTracker(params)
s.logger.Debugw("StreamTrackerManager add track", "layer", layer)
tracker.OnStatusChanged(func(status StreamStatus) {
+1 -1
View File
@@ -27,7 +27,7 @@ func compare(expected *VP8Munger, actual *VP8Munger) bool {
}
func newVP8Munger() *VP8Munger {
return NewVP8Munger(logger.GetDefaultLogger())
return NewVP8Munger(logger.GetLogger())
}
func TestSetLast(t *testing.T) {