Skip to content

Commit

Permalink
fix logger use (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
hn8 authored Nov 2, 2021
1 parent cde4ca3 commit f9a5145
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions pkg/sfu/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/pion/rtcp"
"github.com/pion/rtp"
"github.com/pion/webrtc/v3"
"github.com/rs/zerolog/log"
)

// Receiver defines a interface for a track receivers
Expand Down Expand Up @@ -374,7 +373,7 @@ func (w *WebRTCReceiver) writeRTP(layer int) {
w.deleteDownTrack(layer, dt.id)
w.Unlock()
}
log.Error().Err(err).Str("id", dt.id).Msg("Error writing to down track")
Logger.Error(err, "Error writing to down track", "id", dt.id)
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions pkg/sfu/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import (
"sync"
"time"

"github.com/pion/ion-sfu/pkg/logger"
"github.com/pion/ion-sfu/pkg/relay"
"github.com/rs/zerolog/log"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down Expand Up @@ -105,16 +103,16 @@ func (s *SessionLocal) AddRelayPeer(peerID string, signalData []byte) ([]byte, e
}, &relay.PeerConfig{
SettingEngine: s.config.Setting,
ICEServers: s.config.Configuration.ICEServers,
Logger: logger.New(),
Logger: Logger,
})
if err != nil {
log.Err(err).Msg("Creating relay peer")
Logger.Error(err, "Creating relay peer")
return nil, status.Error(codes.Internal, err.Error())
}

resp, err := p.Answer(signalData)
if err != nil {
log.Err(err).Msg("Creating answer for relay")
Logger.Error(err, "Creating answer for relay")
return nil, err
}

Expand Down

0 comments on commit f9a5145

Please sign in to comment.