GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
gr::logger Class Reference

GR_LOG macros. More...

#include <gnuradio/logger.h>

Public Member Functions

 logger (const std::string &logger_name)
 constructor Provide name of logger to associate with this class More...
 
 ~logger ()=default
 Destructor. More...
 
void set_level (const std::string &level)
 inline function, wrapper to set the logger level More...
 
void set_level (const log_level level)
 
void get_level (std::string &level) const
 inline function, wrapper to get the logger level More...
 
const std::string get_string_level () const
 
log_level get_level () const
 
const std::string & name () const
 
void set_name (const std::string &name)
 
template<typename... Args>
void trace (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for TRACE message More...
 
template<typename... Args>
void debug (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for DEBUG message More...
 
template<typename... Args>
void info (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for INFO message More...
 
template<typename... Args>
void notice (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for INFO message, DEPRECATED More...
 
template<typename... Args>
void warn (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for WARN message More...
 
template<typename... Args>
void error (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for ERROR message More...
 
template<typename... Args>
void crit (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for CRITICAL message More...
 
template<typename... Args>
void alert (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for CRITICAL message, DEPRECATED More...
 
template<typename... Args>
void fatal (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for CRITICAL message, DEPRECATED More...
 
template<typename... Args>
void emerg (format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for CRITICAL message, DEPRECATED More...
 
template<typename... Args>
void log (spdlog::level::level_enum level, format_string_t< Args... > msg, Args &&... args)
 inline function, wrapper for logging with ad-hoc adjustable level More...
 

Public Attributes

underlying_logger_ptr d_logger
 

Detailed Description

GR_LOG macros.

These macros wrap the standard LOG4CPP_LEVEL macros. The available macros are: LOG_DEBUG LOG_INFO LOG_WARN LOG_TRACE LOG_ERROR LOG_ALERT LOG_CRIT LOG_FATAL LOG_EMERG

Logger class for referencing loggers in python. Not needed in C++ (use macros) Wraps and manipulates loggers for python as python has no macros

Constructor & Destructor Documentation

◆ logger()

gr::logger::logger ( const std::string &  logger_name)

constructor Provide name of logger to associate with this class

Parameters
logger_nameName of logger associated with class

Creates a new logger. Loggers inherit the logging level (through gr.prefs or through gr::logging::singleton().set_default_level()) that is set at the time of their creation.

◆ ~logger()

gr::logger::~logger ( )
default

Destructor.

Member Function Documentation

◆ alert()

template<typename... Args>
void gr::logger::alert ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for CRITICAL message, DEPRECATED

References gr::msgport_names::msg().

◆ crit()

template<typename... Args>
void gr::logger::crit ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for CRITICAL message

References gr::msgport_names::msg().

◆ debug()

template<typename... Args>
void gr::logger::debug ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for DEBUG message

References gr::msgport_names::msg().

◆ emerg()

template<typename... Args>
void gr::logger::emerg ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for CRITICAL message, DEPRECATED

References gr::msgport_names::msg().

◆ error()

template<typename... Args>
void gr::logger::error ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for ERROR message

References gr::msgport_names::msg().

◆ fatal()

template<typename... Args>
void gr::logger::fatal ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for CRITICAL message, DEPRECATED

References gr::msgport_names::msg().

◆ get_level() [1/2]

log_level gr::logger::get_level ( ) const

◆ get_level() [2/2]

void gr::logger::get_level ( std::string &  level) const

inline function, wrapper to get the logger level

◆ get_string_level()

const std::string gr::logger::get_string_level ( ) const

◆ info()

template<typename... Args>
void gr::logger::info ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for INFO message

References gr::msgport_names::msg().

◆ log()

template<typename... Args>
void gr::logger::log ( spdlog::level::level_enum  level,
format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for logging with ad-hoc adjustable level

References gr::msgport_names::msg().

◆ name()

const std::string& gr::logger::name ( ) const

◆ notice()

template<typename... Args>
void gr::logger::notice ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for INFO message, DEPRECATED

References gr::msgport_names::msg().

◆ set_level() [1/2]

void gr::logger::set_level ( const log_level  level)

◆ set_level() [2/2]

void gr::logger::set_level ( const std::string &  level)

inline function, wrapper to set the logger level

◆ set_name()

void gr::logger::set_name ( const std::string &  name)

◆ trace()

template<typename... Args>
void gr::logger::trace ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for TRACE message

References gr::msgport_names::msg().

◆ warn()

template<typename... Args>
void gr::logger::warn ( format_string_t< Args... >  msg,
Args &&...  args 
)
inline

inline function, wrapper for WARN message

References gr::msgport_names::msg().

Member Data Documentation

◆ d_logger

underlying_logger_ptr gr::logger::d_logger

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