Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

batchedlogger.h
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 #ifndef DASH_BATCHEDLOGGER_H
6 #define DASH_BATCHEDLOGGER_H
7 
8 #include <tinyformat.h>
9 
11 {
12 private:
13  bool accept;
14  std::string header;
15  std::string msg;
16 public:
17  CBatchedLogger(uint64_t _category, const std::string& _header);
18  virtual ~CBatchedLogger();
19 
20  template<typename... Args>
21  void Batch(const std::string& fmt, const Args&... args)
22  {
23  if (!accept) {
24  return;
25  }
26  msg += " " + strprintf(fmt, args...) + "\n";
27  }
28 
29  void Flush();
30 };
31 
32 #endif//DASH_BATCHEDLOGGER_H
CBatchedLogger(uint64_t _category, const std::string &_header)
std::string msg
Definition: batchedlogger.h:15
#define strprintf
Definition: tinyformat.h:1066
void Batch(const std::string &fmt, const Args &... args)
Definition: batchedlogger.h:21
virtual ~CBatchedLogger()
std::string header
Definition: batchedlogger.h:14
Released under the MIT license