Skip to content

Commit f6bd54c

Browse files
committed
Human-friendly peer disconnect messages (single line, no stack trace)
1 parent c17b5db commit f6bd54c

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/impl/ltc/coin/p2p_node.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ class NodeP2P : public core::ICommunicator, public core::INetwork, public core::
167167
// ICommmunicator
168168
void error(const message_error_type& err, const NetService& service, const std::source_location where = std::source_location::current()) override
169169
{
170-
LOG_ERROR << "" << "[" << m_chain_label << "] <NetName>[" << service.to_string() << "]:";
171-
LOG_ERROR << "\terror: " << err;
172-
LOG_ERROR << "\twhere: " << where.function_name();
170+
LOG_WARNING << "[" << m_chain_label << "] Peer " << service.to_string()
171+
<< " disconnected: " << err;
173172
if (m_peer)
174173
{
175174
m_peer.reset();

src/pool/node.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ class BaseNode : public NodeInterfaces, public core::Factory<core::Server, core:
9999

100100
void error(const message_error_type& err, const NetService& service, const std::source_location where = std::source_location::current()) override
101101
{
102-
LOG_ERROR << "[Pool] <NetName>[" << service.to_string() << "]:";
103-
LOG_ERROR << "\terror: " << err;
104-
LOG_ERROR << "\twhere: " << where.function_name();
102+
LOG_WARNING << "[Pool] Peer " << service.to_string()
103+
<< " disconnected: " << err;
105104
if (m_connections.contains(service))
106105
{
107106
auto node = m_connections.extract(service);

0 commit comments

Comments
 (0)