Loading...
Searching...
No Matches
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
| ~logger ()=default
| Destructor.
void | set_level (const std::string &level)
| inline function, wrapper to set the logger level
void | set_level (const log_level level)
void | get_level (std::string &level) const
| inline function, wrapper to get the logger level
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
template<typename... Args>
void | debug (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for DEBUG message
template<typename... Args>
void | info (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for INFO message
template<typename... Args>
void | notice (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for INFO message, DEPRECATED
template<typename... Args>
void | warn (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for WARN message
template<typename... Args>
void | error (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for ERROR message
template<typename... Args>
void | crit (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for CRITICAL message
template<typename... Args>
void | alert (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for CRITICAL message, DEPRECATED
template<typename... Args>
void | fatal (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for CRITICAL message, DEPRECATED
template<typename... Args>
void | emerg (format_string_t< Args... > msg, Args &&... args)
| inline function, wrapper for CRITICAL message, DEPRECATED
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

## 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_name | Name 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 d_logger.

## crit()

template<typename... Args>

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

inline

inline function, wrapper for CRITICAL message

References d_logger.

## debug()

template<typename... Args>

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

inline

inline function, wrapper for DEBUG message

References d_logger.

## emerg()

template<typename... Args>

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

inline

inline function, wrapper for CRITICAL message, DEPRECATED

References d_logger.

## error()

template<typename... Args>

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

inline

inline function, wrapper for ERROR message

References d_logger.

## fatal()

template<typename... Args>

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

inline

inline function, wrapper for CRITICAL message, DEPRECATED

References d_logger.

## 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 d_logger.

## 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 d_logger.

## name()

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

Referenced by set_name().

## notice()

template<typename... Args>

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

inline

inline function, wrapper for INFO message, DEPRECATED

References d_logger.

## 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 | ) |

References name().

## trace()

template<typename... Args>

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

inline

inline function, wrapper for TRACE message

References d_logger.

## warn()

template<typename... Args>

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

inline

inline function, wrapper for WARN message

References d_logger.

## Member Data Documentation

## d_logger

underlying_logger_ptr gr::logger::d_logger

Referenced by alert(), crit(), debug(), emerg(), error(), fatal(), info(), log(), notice(), trace(), and warn().

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

- logger.h