From 389bbe20601856f7eb7838efa64d082dd4675834 Mon Sep 17 00:00:00 2001 From: Matheus Degiovani Date: Mon, 23 Oct 2023 09:51:49 -0300 Subject: [PATCH] main: Use PEER for p2p logging This makes it easier to debug SPV sync issues by allowing more debugging info for the sync process itself, as opposed to all peer messages exchanged. --- internal/loggers/loggers.go | 1 + log.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/loggers/loggers.go b/internal/loggers/loggers.go index 043f92dab..42010f758 100644 --- a/internal/loggers/loggers.go +++ b/internal/loggers/loggers.go @@ -48,6 +48,7 @@ var ( WalletLog = backendLog.Logger("WLLT") TkbyLog = backendLog.Logger("TKBY") SyncLog = backendLog.Logger("SYNC") + PeerLog = backendLog.Logger("PEER") GrpcLog = backendLog.Logger("GRPC") JsonrpcLog = backendLog.Logger("RPCS") CmgrLog = backendLog.Logger("CMGR") diff --git a/log.go b/log.go index 12474a65b..db2e37997 100644 --- a/log.go +++ b/log.go @@ -32,7 +32,7 @@ func init() { ticketbuyer.UseLogger(loggers.TkbyLog) chain.UseLogger(loggers.SyncLog) spv.UseLogger(loggers.SyncLog) - p2p.UseLogger(loggers.SyncLog) + p2p.UseLogger(loggers.PeerLog) rpcserver.UseLogger(loggers.GrpcLog) jsonrpc.UseLogger(loggers.JsonrpcLog) connmgr.UseLogger(loggers.CmgrLog) @@ -45,6 +45,7 @@ var subsystemLoggers = map[string]slog.Logger{ "WLLT": loggers.WalletLog, "TKBY": loggers.TkbyLog, "SYNC": loggers.SyncLog, + "PEER": loggers.PeerLog, "GRPC": loggers.GrpcLog, "RPCS": loggers.JsonrpcLog, "CMGR": loggers.CmgrLog,