Provides functions to set up logging.
More...
|
| using | nnl::LogFun = void (*)(std::string_view msg, LogLevel log_level) |
| | Type definition for a logging function.
|
Provides functions to set up logging.
- See also
- nnl::SetGlobalLogCB
◆ LogFun
Type definition for a logging function.
- Parameters
-
| msg | The log message to be processed. |
| log_level | The severity level of the log message. |
- See also
- nnl::SetGlobalLogCB
◆ LogLevel
Enum class representing log levels.
| Enumerator |
|---|
| kError | Indicates error conditions.
Further execution is likely not possible, and immediate attention is required.
|
| kWarn | Indicates warning conditions.
Something is not right, and the user may want to take action to mitigate potential issues.
|
◆ SetGlobalLogCB()
| void nnl::SetGlobalLogCB |
( |
LogFun | callback | ) |
|
|
noexcept |
Sets the logging callback function.
- Parameters
-
| callback | The function to be used for logging messages. |
- Note
- To enable log messages, ensure that the library is compiled with the NNL_ENABLE_LOGGING option set. If logging is invoked from multiple threads, it is the user's responsibility to implement appropriate synchronization mechanisms.
- See also
- nnl::LogFun