Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

batchedlogger.cpp
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <batchedlogger.h>
6 #include <util.h>
7 
8 CBatchedLogger::CBatchedLogger(uint64_t _category, const std::string& _header) :
9  accept(LogAcceptCategory(_category)), header(_header)
10 {
11 }
12 
14 {
15  Flush();
16 }
17 
19 {
20  if (!accept || msg.empty()) {
21  return;
22  }
23  LogPrintStr(strprintf("%s:\n%s", header, msg));
24  msg.clear();
25 }
CBatchedLogger(uint64_t _category, const std::string &_header)
std::string msg
Definition: batchedlogger.h:15
#define strprintf
Definition: tinyformat.h:1066
static bool LogAcceptCategory(uint64_t category)
Definition: util.h:152
virtual ~CBatchedLogger()
int LogPrintStr(const std::string &str)
Send a string to the log output.
Definition: util.cpp:422
std::string header
Definition: batchedlogger.h:14
Released under the MIT license