dash/src/batchedlogger.cpp
PastaPastaPasta d931cb723e Update copyright date (2019) (#2970)
Signed-off-by: Pasta <Pasta@dash.org>
2019-06-11 14:46:07 +03:00

26 lines
596 B
C++

// Copyright (c) 2018-2019 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.
#include "batchedlogger.h"
#include "util.h"
CBatchedLogger::CBatchedLogger(uint64_t _category, const std::string& _header) :
accept(LogAcceptCategory(_category)), header(_header)
{
}
CBatchedLogger::~CBatchedLogger()
{
Flush();
}
void CBatchedLogger::Flush()
{
if (!accept || msg.empty()) {
return;
}
LogPrintStr(strprintf("%s:\n%s", header, msg));
msg.clear();
}