dash/src/zmq/zmqutil.cpp
MarcoFalke 28c1396015
Merge bitcoin/bitcoin#22200: zmq: use std::string in zmqError()
3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec zmq: use msg: prefix over errno= in zmqError (fanquake)
9a7cb57bbc61b2dfb772f8486db2a44c1673983a zmq: use std::string in zmqError() (fanquake)

Pull request description:

  This is two minor changes. The first is to change `zmqError` to take a `const std::string&` instead of a `const char*`. The second is to change the second portion of `zmqError` to print `msg: message` rather than `errno=message`, given that `zmq_strerror` returns a message. To me, this seems more readable / useful than output like: `Error: Unable to initialize context errno=No such file or directory`.

ACKs for top commit:
  practicalswift:
    cr ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec
  instagibbs:
    utACK 3f05a9e681
  theStack:
    Code-Review ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec

Tree-SHA512: 197cf381e8b3ced271d0e575e0c6d8e5e9ed93c4b284338b17873c5232eaabe64d6c4b66e1aeb5e76befc89e316abae2b28b7fd760f178481d7b9f4e3f85da67
2021-09-24 13:32:16 -04:00

17 lines
420 B
C++

// Copyright (c) 2014-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <zmq/zmqutil.h>
#include <logging.h>
#include <zmq.h>
#include <cerrno>
#include <string>
void zmqError(const std::string& str)
{
LogPrint(BCLog::ZMQ, "zmq: Error: %s, msg: %s\n", str, zmq_strerror(errno));
}