Skip to content

Commit e870944

Browse files
committed
debug = true の場合にのみ signaling.log に rawMessage を出力するように変更する
1 parent d6b6d87 commit e870944

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
- @voluntas
1818
- [ADD] リリースバイナリに linux arm64 を追加する
1919
- @voluntas
20+
- [CHANGE] debug 設定が有効な場合にのみ、signaling.log に受信したシグナリングの生データを出力するように変更する
21+
- @Hexa
2022

2123
## 2023.2.0
2224

connection_log.go

+15-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@ import (
77

88
func (c *connection) signalingLog(message message, rawMessage []byte) {
99
if message.Type != "pong" {
10-
c.signalingLogger.Log().
11-
Str("roomId", c.roomID).
12-
Str("clientID", c.clientID).
13-
Str("connectionId", c.ID).
14-
Str("type", message.Type).
15-
Msg(string(rawMessage))
10+
if c.config.Debug {
11+
c.signalingLogger.Log().
12+
Str("roomId", c.roomID).
13+
Str("clientID", c.clientID).
14+
Str("connectionId", c.ID).
15+
Str("type", message.Type).
16+
Msg(string(rawMessage))
17+
} else {
18+
c.signalingLogger.Log().
19+
Str("roomId", c.roomID).
20+
Str("clientID", c.clientID).
21+
Str("connectionId", c.ID).
22+
Str("type", message.Type).
23+
Send()
24+
}
1625
}
1726
}
1827

0 commit comments

Comments
 (0)