Skip to content

Commit

Permalink
main: Use PEER for p2p logging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matheusd committed Nov 13, 2023
1 parent 0a63be6 commit 389bbe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/loggers/loggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 389bbe2

Please sign in to comment.