setting-engine.go 594 B

123456789101112131415161718192021222324
  1. // These build constraints are copied from webrtc's settingengine.go.
  2. //go:build !js
  3. // +build !js
  4. package webtorrent
  5. import (
  6. "io"
  7. "github.com/pion/logging"
  8. "github.com/pion/webrtc/v3"
  9. )
  10. var s = webrtc.SettingEngine{
  11. // This could probably be done with better integration into anacrolix/log, but I'm not sure if
  12. // it's worth the effort.
  13. LoggerFactory: discardLoggerFactory{},
  14. }
  15. type discardLoggerFactory struct{}
  16. func (discardLoggerFactory) NewLogger(scope string) logging.LeveledLogger {
  17. return logging.NewDefaultLeveledLoggerForScope(scope, logging.LogLevelInfo, io.Discard)
  18. }