LCOV - code coverage report
Current view: top level - src - batchedlogger.h (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 4 5 80.0 %
Date: 2026-06-25 07:23:43 Functions: 19 20 95.0 %

          Line data    Source code
       1             : // Copyright (c) 2018-2025 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 BITCOIN_BATCHEDLOGGER_H
       6             : #define BITCOIN_BATCHEDLOGGER_H
       7             : 
       8             : #include <logging.h>
       9             : 
      10             : class CBatchedLogger
      11             : {
      12             : private:
      13             :     bool m_accept;
      14             :     BCLog::LogFlags m_category;
      15             :     BCLog::Level m_level;
      16             :     std::string m_logging_function;
      17             :     std::string m_source_file;
      18             :     const int m_source_line;
      19             :     std::string m_msg;
      20             : 
      21             : public:
      22             :     CBatchedLogger(BCLog::LogFlags category, BCLog::Level level, const std::string& logging_function,
      23             :                    const std::string& m_source_file, int m_source_line);
      24             :     virtual ~CBatchedLogger();
      25             : 
      26             :     template<typename... Args>
      27      145561 :     void Batch(const std::string& fmt, const Args&... args)
      28             :     {
      29      145561 :         if (!m_accept) {
      30           0 :             return;
      31             :         }
      32      145561 :         m_msg += "    " + strprintf(fmt, args...) + "\n";
      33      145561 :     }
      34             : 
      35             :     void Flush();
      36             : };
      37             : 
      38             : #endif // BITCOIN_BATCHEDLOGGER_H

Generated by: LCOV version 1.16