-
Notifications
You must be signed in to change notification settings - Fork 672
always include the remote address in connection log entries #560
always include the remote address in connection log entries #560
Conversation
in addition to the peer name This is handy for debugging, especially in situations when there are multiple connections in flight to the same peer.
I settled on the format after experimenting with a few variants.
The remote address comes first since it is all we have to begin with. The vertical bar is a separator that is quite easy to spot, yet doesn't dominate. And it goes well with the brackets, strength wise. The question is whether we should change the weave status output to match. In the 'peers' and 'reconnects' sections. The latter is a no-brainer, imo. The former is debatable. The main argument against it would be that the 'peers' section is primarily denoting a connectivity graph of peers, with the connection details being a secondary concern. @bboreham what do you reckon? You have probably stared at weave logs and |
Consider a snippet of 'Peers' status like this:
The latter two lines already have similar information, albeit in a different order [1]. But the IP address is from the perspective of the peer on the first line; it is not (and should not be, IMO) the IP address from our perspective. So, in that context, I would vote against adding the IP address from our perspective on that first line, because the whole thing then gets very context-dependent. Historically, when staring at It probably would be a good idea to put ourself first in the Peers section, because then you have an unambiguous list of "who am I connected to, and at what IP address" immediately following. [1] Changing that order is probably a good idea, but will disadvantage anybody who has parsed the text. (They should probably use the JSON alternative) |
Ah yes, good point re address perspective. |
to match how they are shown in the logs
it's redundant and the output looks much better w/o it
…n_logging always include the remote address in connection log entries tidy up / declutter some log and status output
in addition to the peer name/nick
This is handy for debugging, especially in situations when there are multiple connections in flight to the same peer.