zmq: prepend zmq to debug messages

This commit is contained in:
Daniel Cousens 2015-11-19 13:27:18 +11:00
parent 14075b189d
commit ffacd27def
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@
void zmqError(const char *str) void zmqError(const char *str)
{ {
LogPrint("zmq", "Error: %s, errno=%s\n", str, zmq_strerror(errno)); LogPrint("zmq", "zmq: Error: %s, errno=%s\n", str, zmq_strerror(errno));
} }
CZMQNotificationInterface::CZMQNotificationInterface() : pcontext(NULL) CZMQNotificationInterface::CZMQNotificationInterface() : pcontext(NULL)
@ -72,7 +72,7 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
// Called at startup to conditionally set up ZMQ socket(s) // Called at startup to conditionally set up ZMQ socket(s)
bool CZMQNotificationInterface::Initialize() bool CZMQNotificationInterface::Initialize()
{ {
LogPrint("zmq", "Initialize notification interface\n"); LogPrint("zmq", "zmq: Initialize notification interface\n");
assert(!pcontext); assert(!pcontext);
pcontext = zmq_init(1); pcontext = zmq_init(1);
@ -110,7 +110,7 @@ bool CZMQNotificationInterface::Initialize()
// Called during shutdown sequence // Called during shutdown sequence
void CZMQNotificationInterface::Shutdown() void CZMQNotificationInterface::Shutdown()
{ {
LogPrint("zmq", "Shutdown notification interface\n"); LogPrint("zmq", "zmq: Shutdown notification interface\n");
if (pcontext) if (pcontext)
{ {
for (std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin(); i!=notifiers.end(); ++i) for (std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin(); i!=notifiers.end(); ++i)

View File

@ -78,7 +78,7 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext)
} }
else else
{ {
LogPrint("zmq", " Reuse socket for address %s\n", address); LogPrint("zmq", "zmq: Reusing socket for address %s\n", address);
psocket = i->second->psocket; psocket = i->second->psocket;
mapPublishNotifiers.insert(std::make_pair(address, this)); mapPublishNotifiers.insert(std::make_pair(address, this));
@ -120,7 +120,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex) bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{ {
uint256 hash = pindex->GetBlockHash(); uint256 hash = pindex->GetBlockHash();
LogPrint("zmq", "Publish hash block %s\n", hash.GetHex()); LogPrint("zmq", "zmq: Publish hashblock %s\n", hash.GetHex());
char data[32]; char data[32];
for (unsigned int i = 0; i < 32; i++) for (unsigned int i = 0; i < 32; i++)
data[31 - i] = hash.begin()[i]; data[31 - i] = hash.begin()[i];
@ -131,7 +131,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction) bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
{ {
uint256 hash = transaction.GetHash(); uint256 hash = transaction.GetHash();
LogPrint("zmq", "Publish hash transaction %s\n", hash.GetHex()); LogPrint("zmq", "zmq: Publish hashtx %s\n", hash.GetHex());
char data[32]; char data[32];
for (unsigned int i = 0; i < 32; i++) for (unsigned int i = 0; i < 32; i++)
data[31 - i] = hash.begin()[i]; data[31 - i] = hash.begin()[i];
@ -141,7 +141,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex) bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{ {
LogPrint("zmq", "Publish raw block %s\n", pindex->GetBlockHash().GetHex()); LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
const Consensus::Params& consensusParams = Params().GetConsensus(); const Consensus::Params& consensusParams = Params().GetConsensus();
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
@ -164,7 +164,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction) bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
{ {
uint256 hash = transaction.GetHash(); uint256 hash = transaction.GetHash();
LogPrint("zmq", "Publish raw transaction %s\n", hash.GetHex()); LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << transaction; ss << transaction;
int rc = zmq_send_multipart(psocket, "rawtx", 5, &(*ss.begin()), ss.size(), 0); int rc = zmq_send_multipart(psocket, "rawtx", 5, &(*ss.begin()), ss.size(), 0);