Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.20.37 Release
    For Test and Development only

    All Data Structures Namespaces 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-2024 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>
    55#include <dw/core/base/Types.h>
    56#include <dw/core/base/Status.h>
    58
    59#ifdef __cplusplus
    60extern "C" {
    61#endif
    62
    64// Forward declaration of dwContextHandle_t to avoid circular dependency.
    65// @note: The API using the dwContextHandle_t is deprecated
    66typedef struct dwContextObject* dwContextHandle_t;
    67typedef struct dwContextObject const* dwConstContextHandle_t;
    68
    69typedef 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
    86typedef void (*dwLogCallback)(dwContextHandle_t context, dwLoggerVerbosity type, char8_t const* msg);
    87
    93typedef void (*dwLoggerCallback)(dwLoggerMessage const* msg);
    94
    115
    136
    151
    165
    179
    200DW_API_PUBLIC dwStatus dwLogger_log(dwConstContextHandle_t const context, dwLoggerVerbosity const verbosity, char8_t const* const msg);
    201
    215
    226
    243
    244#ifdef __cplusplus
    245}
    246#endif
    248#endif // DW_CORE_LOGGER_H_
    dwStatus
    Status definition.
    Definition: ErrorDefs.h:44
    NVIDIA DriveWorks API: Core Warp Primitives
    NVIDIA DriveWorks API: Core Status Methods
    NVIDIA DriveWorks API: Core Types
    NVIDIA DriveWorks API: Core Exports
    struct dwContextObject const * dwConstContextHandle_t
    The Driveworks context handle.
    Definition: Context.h:87
    struct dwContextObject * dwContextHandle_t
    Context handle.
    Definition: Context.h:85
    #define DW_API_PUBLIC
    Definition: Exports.h:56
    dwLoggerVerbosity verbosity
    how severe is the log
    Definition: Logger.h:72
    char8_t const * tag
    name used to group related logs
    Definition: Logger.h:73
    char8_t const * fileName
    file name from where message was logged
    Definition: Logger.h:74
    char8_t const * threadId
    identifier for thread
    Definition: Logger.h:76
    int32_t lineNum
    line number where log originated from
    Definition: Logger.h:75
    char8_t const * msg
    message to log
    Definition: Logger.h:71
    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
    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.
    struct dwContextObject const * dwConstContextHandle_t
    Definition: Logger.h:67
    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.
    DW_API_PUBLIC dwStatus dwLogger_getLogLevel(dwLoggerVerbosity *verbosity)
    Gets the verbosity level of the logger instance.
    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
    DW_API_PUBLIC dwStatus dwLogger_release(void)
    Release logger instance and free up used memory.
    dwLoggerVerbosity
    Holds the verbosity level.
    Definition: LoggerDefs.h:65
    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.
    struct dwContextObject * dwContextHandle_t
    The Driveworks context handle.
    Definition: Logger.h:66
    人人超碰97caoporen国产