GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
gr::dictionary_logger_backend Class Referencefinal

In-Memory Logger. More...

#include <gnuradio/dictionary_logger_backend.h>

Public Types

using log_entry = std::pair< spdlog::log_clock::time_point, std::string >
 
using log_map = std::unordered_map< std::string, std::set< log_entry > >
 

Public Member Functions

 dictionary_logger_backend ()
 Create unfiltered logger. More...
 
 dictionary_logger_backend (std::regex src_regex)
 Create logger that filters according to the specified regex. More...
 
log_map get_map () const
 
 ~dictionary_logger_backend () override
 

Protected Member Functions

void sink_it_ (const spdlog::details::log_msg &message) override
 
void flush_ () override
 

Detailed Description

In-Memory Logger.

Logs the messages passing by, sorted by the name of the logger logging them.

Use by adding a std::shared_ptr to this to the logging system, i.e., make a logger auto new_backend = std::make_shared<gr::dictionary_logger_backend>(); and use it through: gr::logging.singleton()->add_default_backend(new_backend);

After running your work load, get the map and fetch the logged messages from that.

Member Typedef Documentation

◆ log_entry

using gr::dictionary_logger_backend::log_entry = std::pair<spdlog::log_clock::time_point, std::string>

◆ log_map

using gr::dictionary_logger_backend::log_map = std::unordered_map<std::string, std::set<log_entry> >

Constructor & Destructor Documentation

◆ dictionary_logger_backend() [1/2]

gr::dictionary_logger_backend::dictionary_logger_backend ( )

Create unfiltered logger.

◆ dictionary_logger_backend() [2/2]

gr::dictionary_logger_backend::dictionary_logger_backend ( std::regex  src_regex)

Create logger that filters according to the specified regex.

◆ ~dictionary_logger_backend()

gr::dictionary_logger_backend::~dictionary_logger_backend ( )
inlineoverride

Member Function Documentation

◆ flush_()

void gr::dictionary_logger_backend::flush_ ( )
inlineoverrideprotected

◆ get_map()

log_map gr::dictionary_logger_backend::get_map ( ) const
inline

◆ sink_it_()

void gr::dictionary_logger_backend::sink_it_ ( const spdlog::details::log_msg &  message)
overrideprotected

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