mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
d64b7229cd
* chore: bump copyright in configure.ac * chore: bump copyright via copyright_header.py ran command `python3 contrib/devtools/copyright_header.py update .`
33 lines
759 B
C++
33 lines
759 B
C++
// Copyright (c) 2018-2021 The Dash Core developers
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_BATCHEDLOGGER_H
|
|
#define BITCOIN_BATCHEDLOGGER_H
|
|
|
|
#include <logging.h>
|
|
|
|
class CBatchedLogger
|
|
{
|
|
private:
|
|
bool accept;
|
|
std::string header;
|
|
std::string msg;
|
|
public:
|
|
CBatchedLogger(BCLog::LogFlags _category, const std::string& _header);
|
|
virtual ~CBatchedLogger();
|
|
|
|
template<typename... Args>
|
|
void Batch(const std::string& fmt, const Args&... args)
|
|
{
|
|
if (!accept) {
|
|
return;
|
|
}
|
|
msg += " " + strprintf(fmt, args...) + "\n";
|
|
}
|
|
|
|
void Flush();
|
|
};
|
|
|
|
#endif//BITCOIN_BATCHEDLOGGER_H
|