mirror of
https://github.com/livekit/livekit.git
synced 2026-03-29 09:19:53 +00:00
Add session duration and participant kind to closing log. (#4277)
To allow using "participant closing" log entry for calculating things like session duration by paricipant kind or some other client SDK based attribute.
This commit is contained in:
@@ -1365,11 +1365,18 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
|
||||
return nil
|
||||
}
|
||||
|
||||
var sessionDuration time.Duration
|
||||
if activeAt := p.ActiveAt(); !activeAt.IsZero() {
|
||||
sessionDuration = time.Since(activeAt)
|
||||
}
|
||||
p.params.Logger.Infow(
|
||||
"participant closing",
|
||||
"sendLeave", sendLeave,
|
||||
"reason", reason.String(),
|
||||
"isExpectedToResume", isExpectedToResume,
|
||||
"clientInfo", logger.Proto(sutils.ClientInfoWithoutAddress(p.GetClientInfo())),
|
||||
"kind", p.Kind(),
|
||||
"sessionDuration", sessionDuration,
|
||||
)
|
||||
p.closeReason.Store(reason)
|
||||
p.clearDisconnectTimer()
|
||||
|
||||
Reference in New Issue
Block a user