From 7840f6ebe82f1f97c048d3e9aaa4030f210112c7 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 15 Jun 2024 06:57:27 -0400 Subject: [PATCH] cleanup some log messaging for the peer lookup table handler; --- src/common/lookups/PeerListLookup.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/lookups/PeerListLookup.cpp b/src/common/lookups/PeerListLookup.cpp index 2222ee05..5200d598 100644 --- a/src/common/lookups/PeerListLookup.cpp +++ b/src/common/lookups/PeerListLookup.cpp @@ -189,13 +189,12 @@ uint32_t PeerListLookup::find(uint32_t id) bool PeerListLookup::load() { if (m_filename.empty()) { - LogError(LOG_NET, "List file is empty"); return false; } std::ifstream file(m_filename, std::ifstream::in); if (file.fail()) { - LogError("Cannot open the white/blacklist file: %s", m_filename.c_str()); + LogError(LOG_HOST, "Cannot open the peer ID lookup file - %s", m_filename.c_str()); return false; } @@ -212,7 +211,7 @@ bool PeerListLookup::load() uint32_t peerId = ::strtoul(line.c_str(), nullptr, 10); if (peerId != 0) { m_list.push_back(peerId); - LogDebug(LOG_HOST, "Loaded peer ID %u into list from file %s", peerId, m_filename.c_str()); + LogDebug(LOG_HOST, "Loaded peer ID %u into peer lookup table", peerId); } } } @@ -229,14 +228,15 @@ bool PeerListLookup::load() /// True, if lookup table was saved, otherwise false. bool PeerListLookup::save() { + LogDebug(LOG_HOST, "Saving peer lookup file to %s", m_filename.c_str()); + if (m_filename.empty()) { - LogError(LOG_NET, "List file is empty"); return false; } std::ofstream file(m_filename, std::ofstream::out); if (file.fail()) { - LogError("Cannot open the file: %s", m_filename.c_str()); + LogError(LOG_HOST, "Cannot open the peer ID lookup file - %s", m_filename.c_str()); return false; }