Classes | |
struct | logging_info |
Typedefs | |
typedef std::function< void(const uhd::log::logging_info &)> | log_fn_t |
Enumerations | |
enum | severity_level { trace = 0, debug = 1, info = 2, warning = 3, error = 4, fatal = 5, off = 6 } |
Functions | |
boost::optional< uhd::log::severity_level > UHD_API | parse_log_level_from_string (const std::string &log_level_str) |
UHD_API void | set_log_level (uhd::log::severity_level level) |
UHD_API void | set_console_level (uhd::log::severity_level level) |
UHD_API void | set_file_level (uhd::log::severity_level level) |
UHD_API void | set_logger_level (const std::string &logger, uhd::log::severity_level level) |
UHD_API void | add_logger (const std::string &key, log_fn_t logger_fn) |
typedef std::function<void(const uhd::log::logging_info&)> uhd::log::log_fn_t |
Logging function type
Every logging_backend has to define a function with this signature. Can be added to the logging core.
Logging severity levels
Either numeric value or string can be used to define loglevel in CMake and environment variables
Add logging backend to the log system
key | Identifies the logging backend in the logging core |
logger_fn | function which actually logs messages to this backend |
boost::optional<uhd::log::severity_level> UHD_API uhd::log::parse_log_level_from_string | ( | const std::string & | log_level_str | ) |
Parses a severity_level
from a string. If a value could not be parsed, returns none.
UHD_API void uhd::log::set_console_level | ( | uhd::log::severity_level | level | ) |
Set the log level for the console logger (if defined).
Short-hand for set_logger_level("console", level);
UHD_API void uhd::log::set_file_level | ( | uhd::log::severity_level | level | ) |
Set the log level for the file logger (if defined)
Short-hand for set_logger_level("file", level);
UHD_API void uhd::log::set_log_level | ( | uhd::log::severity_level | level | ) |
Set the global log level
The global log level gets applied before the specific log level. So, if the global log level is 'info', no logger can print messages at level 'debug' or below.
UHD_API void uhd::log::set_logger_level | ( | const std::string & | logger, |
uhd::log::severity_level | level | ||
) |
Set the log level for any specific logger.
logger | Name of the logger |
level | New log level for this logger. |
uhd::key_error | if logger was not defined |