• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.6.215 Release
    For Test and Development only

    All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    Logger.h
    Go to the documentation of this file.
    1
    2//
    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-2022 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/Config.h>
    55#include <dw/core/base/Types.h>
    56#include <dw/core/base/Status.h>
    58
    59#ifdef __cplusplus
    60extern "C" {
    61#endif
    62
    66typedef enum dwLoggerVerbosity {
    67 DW_LOG_VERBOSE = 0x0000,
    68 DW_LOG_DEBUG = 0x1000,
    69 DW_LOG_INFO = 0x2000,
    70 DW_LOG_WARN = 0x3000,
    71 DW_LOG_ERROR = 0x4000,
    72 DW_LOG_SILENT = 0x7000
    74
    75typedef struct dwLoggerMessage
    76{
    77 char8_t const* msg;
    79 char8_t const* tag;
    80 char8_t const* fileName;
    81 int32_t lineNum;
    82 char8_t const* threadId;
    84
    92typedef void (*dwLogCallback)(dwContextHandle_t context, dwLoggerVerbosity type, char8_t const* msg);
    93
    99typedef void (*dwLoggerCallback)(dwLoggerMessage const* msg);
    100
    118
    136
    147
    157
    174DW_API_PUBLIC dwStatus dwLogger_log(dwConstContextHandle_t const context, dwLoggerVerbosity const verbosity, char8_t const* const msg);
    175
    186
    193
    206
    207#ifdef __cplusplus
    208}
    209#endif
    211#endif // DW_CORE_LOGGER_H_
    NVIDIA DriveWorks API: Core Status Methods
    NVIDIA DriveWorks API: Core Types
    NVIDIA DriveWorks API: Core Methods
    NVIDIA DriveWorks API: Core Exports
    struct dwContextObject const * dwConstContextHandle_t
    Definition: Context.h:80
    struct dwContextObject * dwContextHandle_t
    Context handle.
    Definition: Context.h:79
    #define DW_API_PUBLIC
    Definition: Exports.h:54
    dwLoggerVerbosity verbosity
    how severe is the log
    Definition: Logger.h:78
    char8_t const * tag
    name used to group related logs
    Definition: Logger.h:79
    char8_t const * fileName
    file name from where message was logged
    Definition: Logger.h:80
    char8_t const * threadId
    identifier for thread
    Definition: Logger.h:82
    int32_t lineNum
    line number where log originated from
    Definition: Logger.h:81
    char8_t const * msg
    message to log
    Definition: Logger.h:77
    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:92
    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.
    DW_API_PUBLIC dwStatus dwLogger_initialize(dwLogCallback msgCallback)
    Creates a new logger instance.
    DW_API_PUBLIC dwStatus dwLogger_logExtended(const dwLoggerMessage *msg)
    Logs message.
    DW_API_PUBLIC dwStatus dwLogger_log(dwConstContextHandle_t const context, dwLoggerVerbosity const verbosity, char8_t const *const msg)
    Logs message.
    DW_API_PUBLIC dwStatus dwLogger_initializeExtended(dwLoggerCallback msgCallback)
    Creates a new logger instance that provides meta-data with the message.
    void(* dwLoggerCallback)(dwLoggerMessage const *msg)
    Defines a user callback method called by the SDK to log the output with meta-data.
    Definition: Logger.h:99
    DW_API_PUBLIC dwStatus dwLogger_release(void)
    Release logger instance and free up used memory.
    dwLoggerVerbosity
    Holds the verbosity level.
    Definition: Logger.h:66
    DW_API_PUBLIC dwStatus dwLogger_setLogLevel(dwLoggerVerbosity const verbosity)
    Sets the verbosity level of the logger instance.
    DW_API_PUBLIC dwStatus dwLogger_enableTimestamps(bool const enabled)
    Enable or disable logging of timestamps before each message.
    @ DW_LOG_WARN
    Log Warning information.
    Definition: Logger.h:70
    @ DW_LOG_INFO
    Log Notice information.
    Definition: Logger.h:69
    @ DW_LOG_DEBUG
    Log Debug information.
    Definition: Logger.h:68
    @ DW_LOG_VERBOSE
    Log everything, default log level.
    Definition: Logger.h:67
    @ DW_LOG_SILENT
    Log nothing.
    Definition: Logger.h:72
    @ DW_LOG_ERROR
    Log Error information.
    Definition: Logger.h:71
    dwStatus
    Status definition.
    Definition: Status.h:170
    人人超碰97caoporen国产