neobytes/src/batchedlogger.h

29 lines
656 B
C
Raw Normal View History

// Copyright (c) 2018-2019 The Dash Core developers
2018-09-14 13:59:02 +02:00
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DASH_BATCHEDLOGGER_H
#define DASH_BATCHEDLOGGER_H
#include "tinyformat.h"
class CBatchedLogger
{
private:
std::string header;
std::string msg;
public:
CBatchedLogger(const std::string& _header);
virtual ~CBatchedLogger();
template<typename... Args>
void Batch(const std::string& fmt, const Args&... args)
2018-09-14 13:59:02 +02:00
{
msg += " " + strprintf(fmt, args...) + "\n";
2018-09-14 13:59:02 +02:00
}
void Flush();
};
2019-01-09 07:29:57 +01:00
#endif//DASH_BATCHEDLOGGER_H