@@ -2,7 +2,10 @@ package onion_message
2
2
3
3
import (
4
4
"context"
5
+ "encoding/hex"
6
+ "log/slog"
5
7
8
+ "github.com/lightningnetwork/lnd/lnutils"
6
9
"github.com/lightningnetwork/lnd/lnwire"
7
10
"github.com/lightningnetwork/lnd/msgmux"
8
11
"github.com/lightningnetwork/lnd/subscribe"
@@ -65,9 +68,11 @@ func (o *OnionEndpoint) SendMessage(ctx context.Context,
65
68
}
66
69
67
70
peer := msg .PeerPub .SerializeCompressed ()
68
- log .Debugf ("OnionEndpoint received OnionMessage from peer %s: " +
69
- "BlindingPoint=%v, OnionPacket[:10]=%x..." , peer ,
70
- onionMsg .PathKey , onionMsg .OnionBlob )
71
+ log .DebugS (ctx , "OnionEndpoint received OnionMessage" ,
72
+ slog .String ("peer" , hex .EncodeToString (peer )),
73
+ lnutils .LogPubKey ("path_key" , onionMsg .PathKey ),
74
+ lnutils .LogBytesPreview ("onion_blob" , onionMsg .OnionBlob ),
75
+ slog .Int ("blob length" , len (onionMsg .OnionBlob )))
71
76
72
77
var peerArr [33 ]byte
73
78
copy (peerArr [:], peer )
@@ -83,7 +88,7 @@ func (o *OnionEndpoint) SendMessage(ctx context.Context,
83
88
OnionBlob : onionMsg .OnionBlob ,
84
89
})
85
90
if err != nil {
86
- log .Errorf ( "Failed to send onion message update: %v " , err )
91
+ log .ErrorS ( ctx , "Failed to send onion message update" , err )
87
92
return false
88
93
}
89
94
0 commit comments