Add remote participant context to logger (#815)

This commit is contained in:
Raja Subramanian
2022-07-07 10:44:10 +05:30
committed by GitHub
parent ef66404a1a
commit 52aed86080
3 changed files with 10 additions and 4 deletions
+2 -1
View File
@@ -129,7 +129,7 @@ func Recover() {
}
// logger helpers
func LoggerWithParticipant(l logger.Logger, identity livekit.ParticipantIdentity, sid livekit.ParticipantID) logger.Logger {
func LoggerWithParticipant(l logger.Logger, identity livekit.ParticipantIdentity, sid livekit.ParticipantID, isRemote bool) logger.Logger {
lr := logr.Logger(l)
if identity != "" {
lr = lr.WithValues("participant", identity)
@@ -137,6 +137,7 @@ func LoggerWithParticipant(l logger.Logger, identity livekit.ParticipantIdentity
if sid != "" {
lr = lr.WithValues("pID", sid)
}
lr = lr.WithValues("remote", isRemote)
return logger.Logger(lr)
}