@@ -52,9 +52,9 @@ func newWithClientOrServer(servers []webrtc.ICEServer, client bool, opts *ConnOp
52
52
// Enables preference to STUN.
53
53
opts .SettingEngine .SetSrflxAcceptanceMinWait (0 )
54
54
opts .SettingEngine .DetachDataChannels ()
55
- lf := logging .NewDefaultLoggerFactory ()
56
- lf .DefaultLogLevel = logging .LogLevelDisabled
57
- opts .SettingEngine .LoggerFactory = lf
55
+ factory := logging .NewDefaultLoggerFactory ()
56
+ factory .DefaultLogLevel = logging .LogLevelWarn
57
+ opts .SettingEngine .LoggerFactory = factory
58
58
api := webrtc .NewAPI (webrtc .WithSettingEngine (opts .SettingEngine ))
59
59
rtc , err := api .NewPeerConnection (webrtc.Configuration {
60
60
ICEServers : servers ,
@@ -224,6 +224,10 @@ func (c *Conn) init() error {
224
224
c .opts .Logger .Debug (context .Background (), "dtls transport state updated" ,
225
225
slog .F ("state" , dtlsTransportState ))
226
226
})
227
+ c .rtc .SCTP ().Transport ().ICETransport ().OnSelectedCandidatePairChange (func (candidatePair * webrtc.ICECandidatePair ) {
228
+ c .opts .Logger .Debug (context .Background (), "selected candidate pair changed" ,
229
+ slog .F ("local" , candidatePair .Local ), slog .F ("remote" , candidatePair .Remote ))
230
+ })
227
231
c .rtc .OnICECandidate (func (iceCandidate * webrtc.ICECandidate ) {
228
232
if iceCandidate == nil {
229
233
return
0 commit comments