NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
Logger

Provides functions to set up logging. More...

Typedefs

using nnl::LogFun = void (*)(std::string_view msg, LogLevel log_level)
 Type definition for a logging function.

Enumerations

enum class  nnl::LogLevel { nnl::LogLevel::kError , nnl::LogLevel::kWarn }
 Enum class representing log levels. More...

Functions

void nnl::SetGlobalLogCB (LogFun callback) noexcept
 Sets the logging callback function.

Detailed Description

Provides functions to set up logging.

See also
nnl::SetGlobalLogCB

Typedef Documentation

◆ LogFun

using nnl::LogFun = void (*)(std::string_view msg, LogLevel log_level)

Type definition for a logging function.

Parameters
msgThe log message to be processed.
log_levelThe severity level of the log message.
See also
nnl::SetGlobalLogCB

Enumeration Type Documentation

◆ LogLevel

enum class nnl::LogLevel
strong

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.

Function Documentation

◆ SetGlobalLogCB()

void nnl::SetGlobalLogCB ( LogFun callback)
noexcept

Sets the logging callback function.

Parameters
callbackThe 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