NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
Logger.h
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2016-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is strictly prohibited.
28 //
30 
50 #ifndef DW_CORE_LOGGER_H_
51 #define DW_CORE_LOGGER_H_
52 
53 #include <dw/core/base/Config.h>
54 #include <dw/core/base/Exports.h>
55 #include <dw/core/base/Types.h>
56 #include <dw/core/base/Status.h>
57 #include <dw/core/logger/LoggerDefs.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 // Forward declaration of dwContextHandle_t to avoid circular dependency.
65 // @note: The API using the dwContextHandle_t is deprecated
66 typedef struct dwContextObject* dwContextHandle_t;
67 typedef struct dwContextObject const* dwConstContextHandle_t;
68 
69 typedef struct dwLoggerMessage
70 {
71  char8_t const* msg;
73  char8_t const* tag;
74  char8_t const* fileName;
75  int32_t lineNum;
76  char8_t const* threadId;
78 
87 
93 typedef void (*dwLoggerCallback)(dwLoggerMessage const* msg);
94 
114 
134 
149 
163 
177 
198 DW_API_PUBLIC dwStatus dwLogger_log(dwConstContextHandle_t const context, dwLoggerVerbosity const verbosity, char8_t const* const msg);
199 
213 
224 
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #endif // DW_CORE_LOGGER_H_
dwLogger_log
DW_API_PUBLIC dwStatus dwLogger_log(dwConstContextHandle_t const context, dwLoggerVerbosity const verbosity, char8_t const *const msg)
Logs message.
dwLogger_initializeExtended
DW_API_PUBLIC dwStatus dwLogger_initializeExtended(dwLoggerCallback msgCallback)
Creates a new logger instance that provides meta-data with the message.
dwLoggerMessage
struct dwLoggerMessage dwLoggerMessage
dwLoggerMessage::msg
char8_t const * msg
message to log
Definition: Logger.h:71
dwLoggerMessage
Definition: Logger.h:69
dwLogCallback
void(* dwLogCallback)(dwContextHandle_t context, dwLoggerVerbosity type, char8_t const *msg)
Defines a user callback method called by the SDK to log the output.
Definition: Logger.h:86
char8_t
char char8_t
Definition: BasicTypes.h:47
dwLoggerMessage::threadId
char8_t const * threadId
identifier for thread
Definition: Logger.h:76
dwLoggerVerbosity
dwLoggerVerbosity
Holds the verbosity level.
Definition: LoggerDefs.h:45
dwLogger_logExtended
DW_API_PUBLIC dwStatus dwLogger_logExtended(const dwLoggerMessage *msg)
Logs message.
void
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
dwLoggerMessage::fileName
char8_t const * fileName
file name from where message was logged
Definition: Logger.h:74
dwLoggerMessage::verbosity
dwLoggerVerbosity verbosity
how severe is the log
Definition: Logger.h:72
dwLogger_getLogLevel
DW_API_PUBLIC dwStatus dwLogger_getLogLevel(dwLoggerVerbosity *verbosity)
Gets the verbosity level of the logger instance.
dwLogger_enableTimestamps
DW_API_PUBLIC dwStatus dwLogger_enableTimestamps(bool const enabled)
Enable or disable logging of timestamps before each message.
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:74
dwLogger_release
DW_API_PUBLIC dwStatus dwLogger_release(void)
Release logger instance and free up used memory.
dwLoggerMessage::lineNum
int32_t lineNum
line number where log originated from
Definition: Logger.h:75
dwLoggerMessage::tag
char8_t const * tag
name used to group related logs
Definition: Logger.h:73
dwLoggerCallback
void(* dwLoggerCallback)(dwLoggerMessage const *msg)
Defines a user callback method called by the SDK to log the output with meta-data.
Definition: Logger.h:93
dwConstContextHandle_t
struct dwContextObject const * dwConstContextHandle_t
The Driveworks context handle.
Definition: Context.h:76
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
dwConstContextHandle_t
struct dwContextObject const * dwConstContextHandle_t
Definition: Logger.h:67
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
The Driveworks context handle.
Definition: Logger.h:66
dwLogger_initialize
DW_API_PUBLIC dwStatus dwLogger_initialize(dwLogCallback msgCallback)
Creates a new logger instance.
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
dwLogger_setLogLevel
DW_API_PUBLIC dwStatus dwLogger_setLogLevel(dwLoggerVerbosity const verbosity)
Sets the verbosity level of the logger instance.
type
const WFDCommitType type
Definition: wfdext.h:123
dwLogger_setThreadId
DW_API_PUBLIC dwStatus dwLogger_setThreadId(char8_t const *threadId)
Set the name of the current thread that will be returned when using extended logger.