From 3884c8c32ce0e2d15484365a7a8e342a2aa7f872 Mon Sep 17 00:00:00 2001 From: Yutaka Takeda Date: Tue, 2 Apr 2019 12:02:28 -0700 Subject: [PATCH] Pass the logger factory to sctp and datachannel Resolves #569 --- datachannel.go | 1 + sctptransport.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/datachannel.go b/datachannel.go index 08f8a73e0ee..276c10fadb1 100644 --- a/datachannel.go +++ b/datachannel.go @@ -133,6 +133,7 @@ func (d *DataChannel) open(sctpTransport *SCTPTransport) error { Priority: datachannel.ChannelPriorityNormal, // TODO: Wiring ReliabilityParameter: reliabilityParameteer, Label: d.label, + LoggerFactory: d.api.settingEngine.LoggerFactory, } dc, err := datachannel.Dial(d.sctpTransport.association, *d.id, cfg) diff --git a/sctptransport.go b/sctptransport.go index ac25d20cb0c..934d2b63fd1 100644 --- a/sctptransport.go +++ b/sctptransport.go @@ -89,7 +89,10 @@ func (r *SCTPTransport) Start(remoteCaps SCTPCapabilities) error { return err } - sctpAssociation, err := sctp.Client(r.dtlsTransport.conn) + sctpAssociation, err := sctp.Client(sctp.Config{ + NetConn: r.dtlsTransport.conn, + LoggerFactory: r.api.settingEngine.LoggerFactory, + }) if err != nil { return err } @@ -132,7 +135,9 @@ func (r *SCTPTransport) acceptDataChannels() { a := r.association r.lock.RUnlock() for { - dc, err := datachannel.Accept(a) + dc, err := datachannel.Accept(a, &datachannel.Config{ + LoggerFactory: r.api.settingEngine.LoggerFactory, + }) if err != nil { r.log.Errorf("Failed to accept data channel: %v", err) // TODO: Kill DataChannel/PeerConnection?