1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page core_usecase4 Logging
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 The NVDIA<sup>®</sup> DriveWorks library implements simple logging, by
8 passing a log message to a user-specified callback.
10 To initialize a logger instance, pass a callback method to the logger
11 initialization. The call must occur before SDK context initialization.
12 For more information, see @ref core_logger_group.
15 // initialize global logger instance to push all logs to the given callback
16 dwLogger_initialize(myLoggerCallback());
18 // log everything above WARN level, i.e. WARN and ERROR
19 dwLogger_setLogLevel(DW_LOG_WARN);
21 dwContextParameters sdkParams = {};
23 dwGetVersion(&sdkVersion);
24 dwInitialize(&sdk, sdkVersion, &sdkParams);
27 @note Currently, logger is a global instance and is not bound to a specific SDK context.
29 A callback method that accepts log messages has the following syntax:
32 void myLoggerCallback(dwContextHandle_t context, dwLoggerVerbosity type, const char* msg)