Skip to content

Commit

Permalink
chore: add debug logging for session id/recording
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Jan 25, 2024
1 parent 6b63361 commit ed62763
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export class SessionRecording {
startRecordingIfEnabled() {
if (this.isRecordingEnabled) {
this.startCaptureAndTrySendingQueuedSnapshots()
logger.info('[SessionRecording] started')
} else {
this.stopRecording()
this.clearBuffer()
Expand All @@ -243,6 +244,7 @@ export class SessionRecording {
this.stopRrweb()
this.stopRrweb = undefined
this._captureStarted = false
logger.info('[SessionRecording] stopped')
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/sessionid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ export class SessionIdManager {
if (noSessionId || activityTimeout || sessionPastMaximumLength) {
sessionId = this._sessionIdGenerator()
windowId = this._windowIdGenerator()
logger.info('[SessionId] new session ID generated', {
sessionId,
windowId,
changeReason: { noSessionId, activityTimeout, sessionPastMaximumLength },
})
startTimestamp = timestamp
valuesChanged = true
} else if (!windowId) {
Expand Down

0 comments on commit ed62763

Please sign in to comment.