DriveWorks SDK Reference

| 0.6.67 Release

Core Logger

Detailed Description

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
}
 Holds the verbosity level. More...
 

Functions

DW_API_PUBLIC dwStatus dwLogger_initialize (dwLogCallback msgCallback)
 Creates a new logger instance. 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 Documentation

◆ dwLogCallback

typedef void(* dwLogCallback) (dwContextHandle_t context, dwLoggerVerbosity type, const char *msg)

Defines a user callback method called by the SDK to log the output.

Parameters
[in]contextSpecifies the DriveWorks context that generated this message. It can be DW_NULL_HANDLE if no context was available when the message was generated.
[in]typeSpecifies the type of message being logged.
[in]msgA pointer to the message.

Definition at line 80 of file Logger.h.

Enumeration Type Documentation

◆ dwLoggerVerbosity

Holds the verbosity level.

Enumerator
DW_LOG_VERBOSE 
DW_LOG_DEBUG 
DW_LOG_WARN 
DW_LOG_ERROR 

Definition at line 65 of file Logger.h.

Function Documentation

◆ dwLogger_initialize()

DW_API_PUBLIC dwStatus dwLogger_initialize ( dwLogCallback  msgCallback)

Creates a new logger instance.

The logger instance can then be passed to the SDK context on creation such that all log output of the SDK are passed to the provided logger instance.

Parameters
[in]msgCallbackSpecifies 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

◆ dwLogger_release()

DW_API_PUBLIC dwStatus dwLogger_release ( )

Release logger instance and free up used memory.

Returns
DW_SUCCESS

◆ dwLogger_setLogLevel()

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.

Parameters
[in]verbositySpecifies the verbosity level to use.
Returns
DW_INVALID_ARGUMENT if verbosity is invalid.
DW_SUCCESS