dash/src/batchedlogger.h
Konstantin Akimov 097a8e7196
non-scripted-diff: bump copyright year to 2023
that's a result of:
contrib/devtools/copyright_header.py update ./

it is not scripted diff, because it works differentlly on my localhost and in CI:
CI doesn't want to use git commit date which is mocked to 30th Dec of 2023
2024-02-24 11:05:37 -06:00

33 lines
759 B
C++

// Copyright (c) 2018-2023 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