Processes wide logger API.
Typedefs | |
| typedef void(* | dwLogCallback) (dwContextHandle_t context, dwLoggerVerbosity type, const char *msg) |
| Defines a user callback method called by the SDK to log the output. More... | |
Enumerations | |
| enum | dwLoggerVerbosity { DW_LOG_VERBOSE = 0x0000, DW_LOG_DEBUG = 0x1000, DW_LOG_WARN = 0x2000, DW_LOG_ERROR = 0x3000, DW_LOG_SILENT = 0x7000 } |
| Holds the verbosity level. More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwLogger_enableTimestamps (bool enabled) |
| Enable or disable logging of timestamps before each message. More... | |
| DW_API_PUBLIC dwStatus | dwLogger_initialize (dwLogCallback msgCallback) |
| Creates a new logger instance. More... | |
| DW_API_PUBLIC dwStatus | dwLogger_log (dwContextHandle_t context, dwLoggerVerbosity verbosity, const char *msg) |
| Logs message. More... | |
| DW_API_PUBLIC dwStatus | dwLogger_release () |
| Release logger instance and free up used memory. More... | |
| DW_API_PUBLIC dwStatus | dwLogger_setLogLevel (dwLoggerVerbosity verbosity) |
| Sets the verbosity level of the logger instance. More... | |
| typedef void(* dwLogCallback) (dwContextHandle_t context, dwLoggerVerbosity type, const char *msg) |
Defines a user callback method called by the SDK to log the output.
| [in] | context | Specifies the DriveWorks context that generated this message. It can be 'DW_NULL_HANDLE' if no context was available when the message was generated. |
| [in] | type | Specifies the type of message being logged. |
| [in] | msg | A pointer to the message. |
| enum dwLoggerVerbosity |
| DW_API_PUBLIC dwStatus dwLogger_enableTimestamps | ( | bool | enabled | ) |
Enable or disable logging of timestamps before each message.
dwLogger is initialized with timestamps enabled.
| [in] | enabled | Whether to log timestamps (true) or not (false). |
| DW_API_PUBLIC dwStatus dwLogger_initialize | ( | dwLogCallback | msgCallback | ) |
Creates a new logger instance.
| [in] | msgCallback | Specifies the callback method used by the SDK to pass log messages. It must be thread-safe. |
return DW_INVALID_ARGUMENT if msgCallback is NULL.
DW_SUCCESS
| DW_API_PUBLIC dwStatus dwLogger_log | ( | dwContextHandle_t | context, |
| dwLoggerVerbosity | verbosity, | ||
| const char * | msg | ||
| ) |
Logs message.
| [in] | context | Specifies the DriveWorks context that generated this message. |
| [in] | verbosity | Specifies the verbosity level to use. |
| [in] | msg | Specifies message which is to be logged. |
| DW_API_PUBLIC dwStatus dwLogger_release | ( | ) |
Release logger instance and free up used memory.
| DW_API_PUBLIC dwStatus dwLogger_setLogLevel | ( | dwLoggerVerbosity | verbosity | ) |
Sets the verbosity level of the logger instance.
Any messages with higher or equal verbosity level is forwarded to the logger callback.
| [in] | verbosity | Specifies the verbosity level to use. |