From dad9a32d3394e2c0ff0c1147aac416ad8f1fe8f9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 21 Apr 2015 01:10:38 +0200 Subject: [PATCH] Better logging. --- CMakeLists.txt | 6 +++--- exp/main.cpp | 9 ++++++++- libdevcore/Log.cpp | 23 ++++++++++++----------- libdevcrypto/MemoryDB.cpp | 3 +++ libdevcrypto/MemoryDB.h | 4 ++-- libdevcrypto/TrieDB.cpp | 2 ++ libdevcrypto/TrieDB.h | 2 +- libethereum/BlockChain.cpp | 5 +++++ libethereum/BlockChain.h | 8 ++++---- libethereum/BlockQueue.cpp | 2 ++ libethereum/BlockQueue.h | 2 +- libethereum/Client.cpp | 5 +++++ libethereum/Client.h | 8 ++++---- libethereum/ClientBase.cpp | 5 +++++ libethereum/ClientBase.h | 8 ++++---- libethereum/Executive.cpp | 2 ++ libethereum/Executive.h | 2 +- libethereum/State.cpp | 5 +++++ libethereum/State.h | 8 ++++---- libethereum/TransactionQueue.cpp | 2 ++ libethereum/TransactionQueue.h | 2 +- libp2p/Common.cpp | 14 ++++++++++++++ libp2p/Common.h | 22 +++++++++++----------- libp2p/NodeTable.cpp | 14 ++++++++++++++ libp2p/NodeTable.h | 26 +++++++++++++------------- libp2p/RLPxHandshake.cpp | 2 +- libp2p/Session.cpp | 3 ++- libtestutils/Common.cpp | 2 ++ libtestutils/Common.h | 2 +- 29 files changed, 134 insertions(+), 64 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18d6a911a..0e8a25942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,11 +242,11 @@ if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x") set(CMAKE_BUILD_TYPE "Release") endif () -# Default TARGET_PLATFORM to ${CMAKE_SYSTEM} +# Default TARGET_PLATFORM to ${CMAKE_SYSTEM_NAME} # change this once we support cross compiling -set(TARGET_PLATFORM CACHE STRING ${CMAKE_SYSTEM}) +set(TARGET_PLATFORM CACHE STRING ${CMAKE_SYSTEM_NAME}) if ("x${TARGET_PLATFORM}" STREQUAL "x") - set(TARGET_PLATFORM ${CMAKE_SYSTEM}) + set(TARGET_PLATFORM ${CMAKE_SYSTEM_NAME}) endif () include(EthDependencies) diff --git a/exp/main.cpp b/exp/main.cpp index 20f287f43..366c5b2ff 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -22,7 +22,14 @@ #if ETH_ETHASHCL #define __CL_ENABLE_EXCEPTIONS #define CL_USE_DEPRECATED_OPENCL_2_0_APIS -#include "libethash-cl/cl.hpp" +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#include +#pragma clang diagnostic pop +#else +#include +#endif #endif #include #include diff --git a/libdevcore/Log.cpp b/libdevcore/Log.cpp index 3123fdf58..c4cacad26 100644 --- a/libdevcore/Log.cpp +++ b/libdevcore/Log.cpp @@ -28,18 +28,18 @@ using namespace std; using namespace dev; -//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»» +//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»»⚙ // Logging int dev::g_logVerbosity = 5; map dev::g_logOverride; -const char* LogChannel::name() { return EthGray "···" EthReset; } -const char* LeftChannel::name() { return EthNavy "◀▬▬" EthReset; } -const char* RightChannel::name() { return EthGreen "▬▬▶" EthReset; } -const char* WarnChannel::name() { return EthOnRed EthBlackBold "✘✘✘" EthReset; } -const char* NoteChannel::name() { return EthGreen " ✔ " EthReset; } -const char* DebugChannel::name() { return EthWhite " ◆ " EthReset; } +const char* LogChannel::name() { return EthGray "···"; } +const char* LeftChannel::name() { return EthNavy "◀▬▬"; } +const char* RightChannel::name() { return EthGreen "▬▬▶"; } +const char* WarnChannel::name() { return EthOnRed EthBlackBold " ✘"; } +const char* NoteChannel::name() { return EthBlue " ℹ"; } +const char* DebugChannel::name() { return EthWhite " ◇"; } LogOutputStreamBase::LogOutputStreamBase(char const* _id, std::type_info const* _info, unsigned _v) { @@ -50,10 +50,11 @@ LogOutputStreamBase::LogOutputStreamBase(char const* _id, std::type_info const* char buf[24]; if (strftime(buf, 24, "%X", localtime(&rawTime)) == 0) buf[0] = '\0'; // empty if case strftime fails - static char const* c_begin = EthWhite " [ " EthReset EthCoalBold; - static char const* c_sep = EthReset EthWhite " | " EthReset EthCoalBold; - static char const* c_end = EthReset EthWhite " ] " EthReset; - m_sstr << _id << c_begin << buf << c_sep << getThreadName() << ThreadContext::join(c_sep) << c_end; + static char const* c_begin = " " EthViolet; + static char const* c_sep1 = EthReset EthBlack "|" EthNavy; + static char const* c_sep2 = EthReset EthBlack "|" EthTeal; + static char const* c_end = EthReset " "; + m_sstr << _id << c_begin << buf << c_sep1 << getThreadName() << ThreadContext::join(c_sep2) << c_end; } } diff --git a/libdevcrypto/MemoryDB.cpp b/libdevcrypto/MemoryDB.cpp index 56b77ddee..ab74173c4 100644 --- a/libdevcrypto/MemoryDB.cpp +++ b/libdevcrypto/MemoryDB.cpp @@ -27,6 +27,9 @@ using namespace dev; namespace dev { +const char* DBChannel::name() { return "TDB"; } +const char* DBWarn::name() { return "TDB"; } + std::map MemoryDB::get() const { if (!m_enforceRefs) diff --git a/libdevcrypto/MemoryDB.h b/libdevcrypto/MemoryDB.h index 7858126f8..58b1339a5 100644 --- a/libdevcrypto/MemoryDB.h +++ b/libdevcrypto/MemoryDB.h @@ -31,8 +31,8 @@ namespace dev { -struct DBChannel: public LogChannel { static const char* name() { return "TDB"; } static const int verbosity = 18; }; -struct DBWarn: public LogChannel { static const char* name() { return "TDB"; } static const int verbosity = 1; }; +struct DBChannel: public LogChannel { static const char* name(); static const int verbosity = 18; }; +struct DBWarn: public LogChannel { static const char* name(); static const int verbosity = 1; }; #define dbdebug clog(DBChannel) #define dbwarn clog(DBWarn) diff --git a/libdevcrypto/TrieDB.cpp b/libdevcrypto/TrieDB.cpp index 6f476c14b..6f84a3e29 100644 --- a/libdevcrypto/TrieDB.cpp +++ b/libdevcrypto/TrieDB.cpp @@ -26,3 +26,5 @@ using namespace dev; h256 const dev::c_shaNull = sha3(rlp("")); h256 const dev::EmptyTrie = c_shaNull; + +const char* TrieDBChannel::name() { return "-T-"; } diff --git a/libdevcrypto/TrieDB.h b/libdevcrypto/TrieDB.h index f645f15fa..68a2c248d 100644 --- a/libdevcrypto/TrieDB.h +++ b/libdevcrypto/TrieDB.h @@ -40,7 +40,7 @@ namespace ldb = leveldb; namespace dev { -struct TrieDBChannel: public LogChannel { static const char* name() { return "-T-"; } static const int verbosity = 17; }; +struct TrieDBChannel: public LogChannel { static const char* name(); static const int verbosity = 17; }; #define tdebug clog(TrieDBChannel) struct InvalidTrie: virtual dev::Exception {}; diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 8dec48e96..8bba5ff1b 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -48,6 +48,11 @@ namespace js = json_spirit; #define ETH_CATCH 1 #define ETH_TIMED_IMPORTS 0 +const char* BlockChainDebug::name() { return EthBlue "☍" EthWhite " ◇"; } +const char* BlockChainWarn::name() { return EthBlue "☍" EthOnRed EthBlackBold " ✘"; } +const char* BlockChainNote::name() { return EthBlue "☍" EthBlue " ℹ"; } +const char* BlockChainChat::name() { return EthBlue "☍" EthWhite " ◌"; } + std::ostream& dev::eth::operator<<(std::ostream& _out, BlockChain const& _bc) { string cmp = toBigEndianString(_bc.currentHash()); diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index be5b931ee..e40d928f9 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -56,10 +56,10 @@ struct AlreadyHaveBlock: virtual Exception {}; struct UnknownParent: virtual Exception {}; struct FutureTime: virtual Exception {}; -struct BlockChainChat: public LogChannel { static const char* name() { return "-B-"; } static const int verbosity = 5; }; -struct BlockChainNote: public LogChannel { static const char* name() { return "=B="; } static const int verbosity = 3; }; -struct BlockChainWarn: public LogChannel { static const char* name() { return "=B="; } static const int verbosity = 1; }; -struct BlockChainDebug: public LogChannel { static const char* name() { return "#B#"; } static const int verbosity = 0; }; +struct BlockChainChat: public LogChannel { static const char* name(); static const int verbosity = 5; }; +struct BlockChainNote: public LogChannel { static const char* name(); static const int verbosity = 3; }; +struct BlockChainWarn: public LogChannel { static const char* name(); static const int verbosity = 1; }; +struct BlockChainDebug: public LogChannel { static const char* name(); static const int verbosity = 0; }; // TODO: Move all this Genesis stuff into Genesis.h/.cpp std::map const& genesisState(); diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 4fd63aa86..b056dc74f 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -29,6 +29,8 @@ using namespace std; using namespace dev; using namespace dev::eth; +const char* BlockQueueChannel::name() { return EthOrange "▣┅▶"; } + ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc, bool _isOurs) { // Check if we already know this block. diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index 1932b2f66..adcc6ab39 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -35,7 +35,7 @@ namespace eth class BlockChain; -struct BlockQueueChannel: public LogChannel { static const char* name() { return "[]Q"; } static const int verbosity = 4; }; +struct BlockQueueChannel: public LogChannel { static const char* name(); static const int verbosity = 4; }; #define cblockq dev::LogOutputStream() struct BlockQueueStatus diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index b39a15e22..b9ddcdbaa 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -124,6 +124,11 @@ std::ostream& dev::eth::operator<<(std::ostream& _out, ActivityReport const& _r) return _out; } +const char* ClientNote::name() { return EthTeal "⧫" EthBlue " ℹ"; } +const char* ClientChat::name() { return EthTeal "⧫" EthWhite " ◌"; } +const char* ClientTrace::name() { return EthTeal "⧫" EthGray " ◎"; } +const char* ClientDetail::name() { return EthTeal "⧫" EthCoal " ●"; } + Client::Client(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _forceAction, u256 _networkId): Worker("eth"), m_vc(_dbPath), diff --git a/libethereum/Client.h b/libethereum/Client.h index b1cfaf4ac..d4c55ef55 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -92,10 +92,10 @@ private: std::array m_octiles; }; -struct ClientNote: public LogChannel { static const char* name() { return "*C*"; } static const int verbosity = 2; }; -struct ClientChat: public LogChannel { static const char* name() { return "=C="; } static const int verbosity = 4; }; -struct ClientTrace: public LogChannel { static const char* name() { return "-C-"; } static const int verbosity = 7; }; -struct ClientDetail: public LogChannel { static const char* name() { return " C "; } static const int verbosity = 14; }; +struct ClientNote: public LogChannel { static const char* name(); static const int verbosity = 2; }; +struct ClientChat: public LogChannel { static const char* name(); static const int verbosity = 4; }; +struct ClientTrace: public LogChannel { static const char* name(); static const int verbosity = 7; }; +struct ClientDetail: public LogChannel { static const char* name(); static const int verbosity = 14; }; struct ActivityReport { diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index 5ac9f44d9..6092879b9 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -31,6 +31,11 @@ using namespace std; using namespace dev; using namespace dev::eth; +const char* WatchChannel::name() { return EthBlue "ℹ" EthWhite " "; } +const char* WorkInChannel::name() { return EthOrange "⚒" EthGreen "▬▶"; } +const char* WorkOutChannel::name() { return EthOrange "⚒" EthNavy "◀▬"; } +const char* WorkChannel::name() { return EthOrange "⚒" EthWhite " "; } + State ClientBase::asOf(BlockNumber _h) const { if (_h == PendingBlock) diff --git a/libethereum/ClientBase.h b/libethereum/ClientBase.h index 629791b31..531318736 100644 --- a/libethereum/ClientBase.h +++ b/libethereum/ClientBase.h @@ -60,11 +60,11 @@ struct ClientWatch mutable std::chrono::system_clock::time_point lastPoll = std::chrono::system_clock::now(); }; -struct WatchChannel: public LogChannel { static const char* name() { return "(o)"; } static const int verbosity = 7; }; +struct WatchChannel: public LogChannel { static const char* name(); static const int verbosity = 7; }; #define cwatch LogOutputStream() -struct WorkInChannel: public LogChannel { static const char* name() { return ">W>"; } static const int verbosity = 16; }; -struct WorkOutChannel: public LogChannel { static const char* name() { return "() #define cworkin LogOutputStream() #define cworkout LogOutputStream() diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index f66059ace..2d8dbdc16 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -31,6 +31,8 @@ using namespace std; using namespace dev; using namespace dev::eth; +const char* VMTraceChannel::name() { return "EVM"; } + Executive::Executive(State& _s, BlockChain const& _bc, unsigned _level): m_s(_s), m_lastHashes(_bc.lastHashes((unsigned)_s.info().number - 1)), diff --git a/libethereum/Executive.h b/libethereum/Executive.h index c55341cb8..8903fd464 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -35,7 +35,7 @@ class BlockChain; class ExtVM; struct Manifest; -struct VMTraceChannel: public LogChannel { static const char* name() { return "EVM"; } static const int verbosity = 11; }; +struct VMTraceChannel: public LogChannel { static const char* name(); static const int verbosity = 11; }; /** * @brief Message-call/contract-creation executor; useful for executing transactions. diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 598dac37d..ea2834cc1 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -47,6 +47,11 @@ using namespace dev::eth; static const u256 c_blockReward = 1500 * finney; +const char* StateSafeExceptions::name() { return EthViolet "⚙" EthBlue " ℹ"; } +const char* StateDetail::name() { return EthViolet "⚙" EthWhite " ◌"; } +const char* StateTrace::name() { return EthViolet "⚙" EthGray " ◎"; } +const char* StateChat::name() { return EthViolet "⚙" EthWhite " ◌"; } + OverlayDB State::openDB(std::string _path, WithExisting _we) { if (_path.empty()) diff --git a/libethereum/State.h b/libethereum/State.h index 1b36cbceb..85ca30649 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -50,10 +50,10 @@ namespace eth class BlockChain; class State; -struct StateChat: public LogChannel { static const char* name() { return "-S-"; } static const int verbosity = 4; }; -struct StateTrace: public LogChannel { static const char* name() { return "=S="; } static const int verbosity = 7; }; -struct StateDetail: public LogChannel { static const char* name() { return "/S/"; } static const int verbosity = 14; }; -struct StateSafeExceptions: public LogChannel { static const char* name() { return "(S)"; } static const int verbosity = 21; }; +struct StateChat: public LogChannel { static const char* name(); static const int verbosity = 4; }; +struct StateTrace: public LogChannel { static const char* name(); static const int verbosity = 7; }; +struct StateDetail: public LogChannel { static const char* name(); static const int verbosity = 14; }; +struct StateSafeExceptions: public LogChannel { static const char* name(); static const int verbosity = 21; }; enum class BaseState { diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index c23fd8db4..a4eb5cee8 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -28,6 +28,8 @@ using namespace std; using namespace dev; using namespace dev::eth; +const char* TransactionQueueChannel::name() { return EthCyan "┉┅▶"; } + ImportResult TransactionQueue::import(bytesConstRef _transactionRLP, ImportCallback const& _cb, IfDropped _ik) { // Check if we already know this transaction. diff --git a/libethereum/TransactionQueue.h b/libethereum/TransactionQueue.h index e2d1c3aee..3858949cc 100644 --- a/libethereum/TransactionQueue.h +++ b/libethereum/TransactionQueue.h @@ -35,7 +35,7 @@ namespace eth class BlockChain; -struct TransactionQueueChannel: public LogChannel { static const char* name() { return "->Q"; } static const int verbosity = 4; }; +struct TransactionQueueChannel: public LogChannel { static const char* name(); static const int verbosity = 4; }; #define ctxq dev::LogOutputStream() enum class IfDropped { Ignore, Retry }; diff --git a/libp2p/Common.cpp b/libp2p/Common.cpp index 7206ec835..1853679cf 100644 --- a/libp2p/Common.cpp +++ b/libp2p/Common.cpp @@ -32,6 +32,20 @@ const dev::p2p::Node dev::p2p::UnspecifiedNode = dev::p2p::Node(NodeId(), Unspec bool dev::p2p::NodeIPEndpoint::test_allowLocal = false; +//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»»⚙━┅┉▬ + +const char* NetWarn::name() { return EthYellow "⧎" EthRed " ✘"; } +const char* NetImpolite::name() { return EthYellow "⧎" EthRed " !"; } +const char* NetNote::name() { return EthYellow "⧎" EthBlue " ℹ"; } +const char* NetConnect::name() { return EthYellow "⧎" EthYellow " ▢"; } +const char* NetMessageSummary::name() { return EthYellow "⧎" EthWhite " ◌"; } +const char* NetMessageDetail::name() { return EthYellow "⧎" EthGray " ○"; } +const char* NetTriviaSummary::name() { return EthYellow "⧎" EthGray " ◎"; } +const char* NetTriviaDetail::name() { return EthYellow "⧎" EthCoal " ◍"; } +const char* NetAllDetail::name() { return EthYellow "⧎" EthCoal " ●"; } +const char* NetRight::name() { return EthYellow "⧎" EthGreen "▬▶"; } +const char* NetLeft::name() { return EthYellow "⧎" EthNavy "◀▬"; } + bool p2p::isPublicAddress(std::string const& _addressToCheck) { return _addressToCheck.empty() ? false : isPublicAddress(bi::address::from_string(_addressToCheck)); diff --git a/libp2p/Common.h b/libp2p/Common.h index 691ef7fb3..378064e7d 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -75,17 +75,17 @@ struct NetworkStartRequired: virtual dev::Exception {}; struct InvalidPublicIPAddress: virtual dev::Exception {}; struct InvalidHostIPAddress: virtual dev::Exception {}; -struct NetWarn: public LogChannel { static const char* name() { return "!N!"; } static const int verbosity = 0; }; -struct NetNote: public LogChannel { static const char* name() { return "*N*"; } static const int verbosity = 1; }; -struct NetImpolite: public LogChannel { static const char* name() { return "#!*"; } static const int verbosity = 1; }; -struct NetMessageSummary: public LogChannel { static const char* name() { return "-N-"; } static const int verbosity = 2; }; -struct NetConnect: public LogChannel { static const char* name() { return "+N+"; } static const int verbosity = 10; }; -struct NetMessageDetail: public LogChannel { static const char* name() { return "=N="; } static const int verbosity = 5; }; -struct NetTriviaSummary: public LogChannel { static const char* name() { return "-N-"; } static const int verbosity = 10; }; -struct NetTriviaDetail: public LogChannel { static const char* name() { return "=N="; } static const int verbosity = 11; }; -struct NetAllDetail: public LogChannel { static const char* name() { return "=N="; } static const int verbosity = 13; }; -struct NetRight: public LogChannel { static const char* name() { return ">N>"; } static const int verbosity = 14; }; -struct NetLeft: public LogChannel { static const char* name() { return ">P"; } +const char* NodeTableIngress::name() { return "< void interpretRLP(bytesConstRef _bytes) { RLP r(_bytes); for (auto n: r[0]) nodes.push_back(Node(n)); ts = r[1].toInt(); } }; -struct NodeTableWarn: public LogChannel { static const char* name() { return "!P!"; } static const int verbosity = 0; }; -struct NodeTableNote: public LogChannel { static const char* name() { return "*P*"; } static const int verbosity = 1; }; -struct NodeTableMessageSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 2; }; -struct NodeTableMessageDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 5; }; -struct NodeTableConnect: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; }; -struct NodeTableEvent: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; }; -struct NodeTableTimer: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; }; -struct NodeTableUpdate: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; }; -struct NodeTableTriviaSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 10; }; -struct NodeTableTriviaDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 11; }; -struct NodeTableAllDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 13; }; -struct NodeTableEgress: public LogChannel { static const char* name() { return ">>P"; } static const int verbosity = 14; }; -struct NodeTableIngress: public LogChannel { static const char* name() { return "<remoteEndpoint().address().is_unspecified()) - clog(NetWarn) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; + clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; cancel(); } }); diff --git a/libp2p/Session.cpp b/libp2p/Session.cpp index 61de42791..363953a20 100644 --- a/libp2p/Session.cpp +++ b/libp2p/Session.cpp @@ -436,7 +436,8 @@ void Session::doRead() auto tlen = frameSize + ((16 - (frameSize % 16)) % 16) + h128::size; ba::async_read(m_socket, boost::asio::buffer(m_data, tlen), [this, self, headerRLP, frameSize, tlen](boost::system::error_code ec, std::size_t length) { - ThreadContext tc(info().id.abridged() + " | " + info().clientVersion); + ThreadContext tc(info().id.abridged()); + ThreadContext tc2(info().clientVersion); if (ec && ec.category() != boost::asio::error::get_misc_category() && ec.value() != boost::asio::error::eof) { clog(NetWarn) << "Error reading: " << ec.message(); diff --git a/libtestutils/Common.cpp b/libtestutils/Common.cpp index 86f96f667..3c1350a99 100644 --- a/libtestutils/Common.cpp +++ b/libtestutils/Common.cpp @@ -29,6 +29,8 @@ using namespace std; using namespace dev; using namespace dev::test; +const char* TestChannel::name() { return "TST"; } + std::string dev::test::getTestPath() { string testPath; diff --git a/libtestutils/Common.h b/libtestutils/Common.h index 4757a3b7a..f7f786323 100644 --- a/libtestutils/Common.h +++ b/libtestutils/Common.h @@ -30,7 +30,7 @@ namespace dev namespace test { -struct TestChannel: public LogChannel { static const char* name() { return "TEST"; } }; +struct TestChannel: public LogChannel { static const char* name(); }; #define ctest dev::LogOutputStream() std::string getTestPath();