Skip to content

Commit

Permalink
Code refactoring for debug packet logger
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 25, 2024
1 parent 0ccfcb0 commit 8e571a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Logger(include func(packet *rtp.Packet) bool) func(packet *rtp.Packet) {
now := time.Now()

fmt.Printf(
"%s: size:%6d, ts:%10d, type:%2d, ssrc:%d, seq:%5d, mark:%t, dts:%4d, dtime:%3d\n",
"%s: size=%6d ts=%10d type=%2d ssrc=%d seq=%5d mark=%t dts=%4d dtime=%3dms\n",
now.Format("15:04:05.000"),
len(packet.Payload), packet.Timestamp, packet.PayloadType, packet.SSRC, packet.SequenceNumber, packet.Marker,
packet.Timestamp-lastTS, now.Sub(lastTime).Milliseconds(),
Expand All @@ -41,7 +41,7 @@ func Logger(include func(packet *rtp.Packet) bool) func(packet *rtp.Packet) {

if dt := now.Sub(secTime); dt > time.Second {
fmt.Printf(
"%s: size:%6d, cnt:%d, dts: %d, dtime:%d\n",
"%s: size=%6d cnt=%d dts=%d dtime=%3dms\n",
now.Format("15:04:05.000"),
secSize, secCnt, lastTS-secTS, dt.Milliseconds(),
)
Expand Down

0 comments on commit 8e571a6

Please sign in to comment.