RichΛrd 0babdad17b
chore: upgrade go-waku to v0.5 (#3213)
* chore: upgrade go-waku to v0.5
* chore: add println and logs to check what's being stored in the enr, and preemptively delete the multiaddr field (#3219)
* feat: add wakuv2 test (#3218)
2023-02-22 17:58:17 -04:00

29 lines
498 B
Go

package config
import (
"strings"
"sync"
logging "github.com/ipfs/go-log/v2"
"go.uber.org/fx/fxevent"
)
var log = logging.Logger("p2p-config")
var (
fxLogger fxevent.Logger
logInitOnce sync.Once
)
type fxLogWriter struct{}
func (l *fxLogWriter) Write(b []byte) (int, error) {
log.Debug(strings.TrimSuffix(string(b), "\n"))
return len(b), nil
}
func getFXLogger() fxevent.Logger {
logInitOnce.Do(func() { fxLogger = &fxevent.ConsoleLogger{W: &fxLogWriter{}} })
return fxLogger
}