Browse Source

Better logging.

cl-refactor
Gav Wood 10 years ago
parent
commit
dad9a32d33
  1. 6
      CMakeLists.txt
  2. 9
      exp/main.cpp
  3. 23
      libdevcore/Log.cpp
  4. 3
      libdevcrypto/MemoryDB.cpp
  5. 4
      libdevcrypto/MemoryDB.h
  6. 2
      libdevcrypto/TrieDB.cpp
  7. 2
      libdevcrypto/TrieDB.h
  8. 5
      libethereum/BlockChain.cpp
  9. 8
      libethereum/BlockChain.h
  10. 2
      libethereum/BlockQueue.cpp
  11. 2
      libethereum/BlockQueue.h
  12. 5
      libethereum/Client.cpp
  13. 8
      libethereum/Client.h
  14. 5
      libethereum/ClientBase.cpp
  15. 8
      libethereum/ClientBase.h
  16. 2
      libethereum/Executive.cpp
  17. 2
      libethereum/Executive.h
  18. 5
      libethereum/State.cpp
  19. 8
      libethereum/State.h
  20. 2
      libethereum/TransactionQueue.cpp
  21. 2
      libethereum/TransactionQueue.h
  22. 14
      libp2p/Common.cpp
  23. 22
      libp2p/Common.h
  24. 14
      libp2p/NodeTable.cpp
  25. 26
      libp2p/NodeTable.h
  26. 2
      libp2p/RLPxHandshake.cpp
  27. 3
      libp2p/Session.cpp
  28. 2
      libtestutils/Common.cpp
  29. 2
      libtestutils/Common.h

6
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)

9
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 <libethash-cl/cl.hpp>
#pragma clang diagnostic pop
#else
#include <libethash-cl/cl.hpp>
#endif
#endif
#include <functional>
#include <boost/filesystem.hpp>

23
libdevcore/Log.cpp

@ -28,18 +28,18 @@
using namespace std;
using namespace dev;
//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»»
//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»»
// Logging
int dev::g_logVerbosity = 5;
map<type_info const*, bool> 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;
}
}

3
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<h256, std::string> MemoryDB::get() const
{
if (!m_enforceRefs)

4
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)

2
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-"; }

2
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 {};

5
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());

8
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<Address, Account> const& genesisState();

2
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.

2
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<dev::eth::BlockQueueChannel, true>()
struct BlockQueueStatus

5
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),

8
libethereum/Client.h

@ -92,10 +92,10 @@ private:
std::array<u256, 9> 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
{

5
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)

8
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<WatchChannel, true>()
struct WorkInChannel: public LogChannel { static const char* name() { return ">W>"; } static const int verbosity = 16; };
struct WorkOutChannel: public LogChannel { static const char* name() { return "<W<"; } static const int verbosity = 16; };
struct WorkChannel: public LogChannel { static const char* name() { return "-W-"; } static const int verbosity = 21; };
struct WorkInChannel: public LogChannel { static const char* name(); static const int verbosity = 16; };
struct WorkOutChannel: public LogChannel { static const char* name(); static const int verbosity = 16; };
struct WorkChannel: public LogChannel { static const char* name(); static const int verbosity = 21; };
#define cwork LogOutputStream<WorkChannel, true>()
#define cworkin LogOutputStream<WorkInChannel, true>()
#define cworkout LogOutputStream<WorkOutChannel, true>()

2
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)),

2
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.

5
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())

8
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
{

2
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.

2
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<dev::eth::TransactionQueueChannel, true>()
enum class IfDropped { Ignore, Retry };

14
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));

22
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 "<N<"; } static const int verbosity = 15; };
struct NetWarn: public LogChannel { static const char* name(); static const int verbosity = 0; };
struct NetNote: public LogChannel { static const char* name(); static const int verbosity = 1; };
struct NetImpolite: public LogChannel { static const char* name(); static const int verbosity = 1; };
struct NetMessageSummary: public LogChannel { static const char* name(); static const int verbosity = 2; };
struct NetConnect: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NetMessageDetail: public LogChannel { static const char* name(); static const int verbosity = 5; };
struct NetTriviaSummary: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NetTriviaDetail: public LogChannel { static const char* name(); static const int verbosity = 11; };
struct NetAllDetail: public LogChannel { static const char* name(); static const int verbosity = 13; };
struct NetRight: public LogChannel { static const char* name(); static const int verbosity = 14; };
struct NetLeft: public LogChannel { static const char* name(); static const int verbosity = 15; };
enum PacketType
{

14
libp2p/NodeTable.cpp

@ -24,6 +24,20 @@ using namespace std;
using namespace dev;
using namespace dev::p2p;
const char* NodeTableWarn::name() { return "!P!"; }
const char* NodeTableNote::name() { return "*P*"; }
const char* NodeTableMessageSummary::name() { return "-P-"; }
const char* NodeTableMessageDetail::name() { return "=P="; }
const char* NodeTableConnect::name() { return "+P+"; }
const char* NodeTableEvent::name() { return "+P+"; }
const char* NodeTableTimer::name() { return "+P+"; }
const char* NodeTableUpdate::name() { return "+P+"; }
const char* NodeTableTriviaSummary::name() { return "-P-"; }
const char* NodeTableTriviaDetail::name() { return "=P="; }
const char* NodeTableAllDetail::name() { return "=P="; }
const char* NodeTableEgress::name() { return ">>P"; }
const char* NodeTableIngress::name() { return "<<P"; }
NodeEntry::NodeEntry(Node _src, Public _pubk, NodeIPEndpoint _gw): Node(_pubk, _gw), distance(NodeTable::distance(_src.id,_pubk)) {}
NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint const& _endpoint):

26
libp2p/NodeTable.h

@ -416,19 +416,19 @@ struct Neighbours: RLPXDatagram<Neighbours>
void interpretRLP(bytesConstRef _bytes) { RLP r(_bytes); for (auto n: r[0]) nodes.push_back(Node(n)); ts = r[1].toInt<unsigned>(); }
};
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 "<<P"; } static const int verbosity = 15; };
struct NodeTableWarn: public LogChannel { static const char* name(); static const int verbosity = 0; };
struct NodeTableNote: public LogChannel { static const char* name(); static const int verbosity = 1; };
struct NodeTableMessageSummary: public LogChannel { static const char* name(); static const int verbosity = 2; };
struct NodeTableMessageDetail: public LogChannel { static const char* name(); static const int verbosity = 5; };
struct NodeTableConnect: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NodeTableEvent: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NodeTableTimer: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NodeTableUpdate: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NodeTableTriviaSummary: public LogChannel { static const char* name(); static const int verbosity = 10; };
struct NodeTableTriviaDetail: public LogChannel { static const char* name(); static const int verbosity = 11; };
struct NodeTableAllDetail: public LogChannel { static const char* name(); static const int verbosity = 13; };
struct NodeTableEgress: public LogChannel { static const char* name(); static const int verbosity = 14; };
struct NodeTableIngress: public LogChannel { static const char* name(); static const int verbosity = 15; };
}
}

2
libp2p/RLPxHandshake.cpp

@ -279,7 +279,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech)
if (!_ec)
{
if (!m_socket->remoteEndpoint().address().is_unspecified())
clog(NetWarn) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)";
clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)";
cancel();
}
});

3
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();

2
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;

2
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<dev::test::TestChannel, true>()
std::string getTestPath();

Loading…
Cancel
Save