Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Pass the logger factory to sctp and datachannel
Browse files Browse the repository at this point in the history
Resolves pion#569
  • Loading branch information
enobufs committed Apr 6, 2019
1 parent c7a5c7b commit 3884c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions datachannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions sctptransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 3884c8c

Please sign in to comment.