|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
Thread-safe logger class for handling logging operations. More...
#include "logging.h"
Public Types | |
| using | Callback = void(*)(Level level, const std::string &line, void *user_data) |
Public Member Functions | |
| void | setLevel (Level level) noexcept |
| Sets the logging level. | |
| Level | getLevel () const noexcept |
| Gets the current logging level. | |
| void | setCallback (Callback callback, void *user_data) noexcept |
| Sets an optional callback that receives each formatted log line. | |
| void | log (Level level, const std::string &message, const std::source_location &location=std::source_location::current()) noexcept |
| Logs a message with a specific log level and source location. | |
| template<typename... Args> | |
| void | log (const Level level, const std::source_location &location, const std::string &formatStr, Args &&... args) noexcept |
| Logs a formatted message with a specific log level and source location. | |
| std::expected< void, std::string > | logToFile (const std::string &filePath) noexcept |
| Sets the log file path to log messages to a file. | |
| using logging::Logger::Callback = void (*)(Level level, const std::string& line, void* user_data) |
|
noexcept |
Gets the current logging level.
Definition at line 27 of file logging.cpp.
Referenced by log().
Here is the caller graph for this function:
|
noexcept |
Logs a formatted message with a specific log level and source location.
| Args | Variadic template for format arguments. |
| level | The log level. |
| location | The source location of the log call. |
| formatStr | The format string. |
| args | The format arguments. |
Definition at line 99 of file logging.h.
References getLevel(), log(), and logging::OFF.
Here is the call graph for this function:
|
noexcept |
Logs a message with a specific log level and source location.
| level | The log level. |
| message | The message to log. |
| location | The source location of the log call. |
Definition at line 45 of file logging.cpp.
References logging::getLevelString(), and logging::OFF.
Referenced by fers_log(), log(), and logging::log().
Here is the call graph for this function:
Here is the caller graph for this function:
|
noexcept |
Sets the log file path to log messages to a file.
| filePath | The path to the log file. |
Definition at line 90 of file logging.cpp.
Referenced by fers_configure_logging().
Here is the caller graph for this function:
|
noexcept |
Sets an optional callback that receives each formatted log line.
| callback | Callback to invoke after a log line is accepted, or nullptr to disable. |
| user_data | Opaque caller data passed back to the callback. |
Definition at line 83 of file logging.cpp.
Referenced by fers_set_log_callback().
Here is the caller graph for this function:
|
noexcept |
Sets the logging level.
| level | The logging level to set. |
Definition at line 25 of file logging.cpp.
Referenced by fers_configure_logging().
Here is the caller graph for this function: