Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DebugLogHelper Class Reference

#include <logging.h>

Public Member Functions

 DebugLogHelper (std::string message, MatchFn match=[](const std::string *){ return true;})
 
 ~DebugLogHelper ()
 

Private Types

using MatchFn = std::function< bool(const std::string *line)>
 Custom match checking function. More...
 

Private Member Functions

void check_found ()
 

Private Attributes

const std::string m_message
 
bool m_found {false}
 
std::list< std::function< void(const std::string &)> >::iterator m_print_connection
 
MatchFn m_match
 

Detailed Description

Definition at line 14 of file logging.h.

Member Typedef Documentation

◆ MatchFn

using DebugLogHelper::MatchFn = std::function<bool(const std::string* line)>
private

Custom match checking function.

Invoked with pointers to lines containing matching strings, and with null if check_found() is called without any successful match.

Can return true to enable default DebugLogHelper behavior of: (1) ending search after first successful match, and (2) raising an error in check_found if no match was found Can return false to do the opposite in either case.

Definition at line 29 of file logging.h.

Constructor & Destructor Documentation

◆ DebugLogHelper()

DebugLogHelper::DebugLogHelper ( std::string  message,
MatchFn  match = [](const std::string*){ return true; } 
)
explicit

Definition at line 13 of file logging.cpp.

Here is the call graph for this function:

◆ ~DebugLogHelper()

DebugLogHelper::~DebugLogHelper ( )
inline

Definition at line 36 of file logging.h.

Here is the call graph for this function:

Member Function Documentation

◆ check_found()

void DebugLogHelper::check_found ( )
private

Definition at line 24 of file logging.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_found

bool DebugLogHelper::m_found {false}
private

Definition at line 17 of file logging.h.

◆ m_match

MatchFn DebugLogHelper::m_match
private

Definition at line 30 of file logging.h.

◆ m_message

const std::string DebugLogHelper::m_message
private

Definition at line 16 of file logging.h.

◆ m_print_connection

std::list<std::function<void(const std::string&)> >::iterator DebugLogHelper::m_print_connection
private

Definition at line 18 of file logging.h.


The documentation for this class was generated from the following files: