Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
test
util
logging.h
Go to the documentation of this file.
1
// Copyright (c) 2019-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_TEST_UTIL_LOGGING_H
6
#define BITCOIN_TEST_UTIL_LOGGING_H
7
8
#include <
util/macros.h
>
9
10
#include <functional>
11
#include <list>
12
#include <string>
13
14
class
DebugLogHelper
15
{
16
public
:
26
using
MatchFn
= std::function<bool(
const
std::string* line)>;
27
28
explicit
DebugLogHelper
(std::string message,
MatchFn
match = [](
const
std::string*){
return
true
; });
29
30
DebugLogHelper
(
const
DebugLogHelper
&) =
delete
;
31
DebugLogHelper
&
operator=
(
const
DebugLogHelper
&) =
delete
;
32
33
~DebugLogHelper
();
34
35
private
:
36
const
std::string
m_message
;
37
bool
m_found
{
false
};
38
std::list<std::function<void(
const
std::string&)>>::iterator
m_print_connection
;
39
MatchFn
m_match
;
40
};
41
42
#define ASSERT_DEBUG_LOG(message) DebugLogHelper UNIQUE_NAME(debugloghelper)(message)
43
44
#endif
// BITCOIN_TEST_UTIL_LOGGING_H
DebugLogHelper::DebugLogHelper
DebugLogHelper(const DebugLogHelper &)=delete
DebugLogHelper::m_print_connection
std::list< std::function< void(conststd::string &)> >::iterator m_print_connection
Definition
logging.h:38
DebugLogHelper::MatchFn
std::function< bool(const std::string *line)> MatchFn
Definition
logging.h:26
DebugLogHelper::m_match
MatchFn m_match
Definition
logging.h:39
DebugLogHelper::~DebugLogHelper
~DebugLogHelper()
Definition
logging.cpp:25
DebugLogHelper::DebugLogHelper
DebugLogHelper(std::string message, MatchFn match=[](const std::string *){ return true;})
Definition
logging.cpp:14
DebugLogHelper::m_message
const std::string m_message
Definition
logging.h:36
DebugLogHelper::operator=
DebugLogHelper & operator=(const DebugLogHelper &)=delete
DebugLogHelper::m_found
bool m_found
Definition
logging.h:37
macros.h
Generated on
for Bitcoin Core by
1.17.0