DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Core Logger

Detailed Description

Processes wide logger API.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Typedefs

typedef void(* dwLogCallback) (dwContextHandle_t context, dwLoggerVerbosity type, const char8_t *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 char8_t *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 Documentation

◆ dwLogCallback

typedef void(* dwLogCallback) (dwContextHandle_t context, dwLoggerVerbosity type, const char8_t *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 82 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 
DW_LOG_SILENT 

Definition at line 66 of file Logger.h.

Function Documentation

◆ dwLogger_enableTimestamps()

DW_API_PUBLIC dwStatus dwLogger_enableTimestamps ( bool  enabled)

Enable or disable logging of timestamps before each message.

dwLogger is initialized with timestamps enabled.

Parameters
[in]enabledWhether to log timestamps (true) or not (false).
Returns
DW_SUCCESS

◆ dwLogger_initialize()

DW_API_PUBLIC dwStatus dwLogger_initialize ( dwLogCallback  msgCallback)

Creates a new 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_log()

DW_API_PUBLIC dwStatus dwLogger_log ( dwContextHandle_t  context,
dwLoggerVerbosity  verbosity,
const char8_t msg 
)

Logs message.

Parameters
[in]contextSpecifies the DriveWorks context that generated this message.
[in]verbositySpecifies the verbosity level to use.
[in]msgSpecifies message which is to be logged.
Returns
DW_INVALID_ARGUMENT if verbosity is invalid.
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