TensorRT 10.0.0
nvinfer1::ILogger Class Referenceabstract

Application-implemented logging interface for the builder, refitter and runtime. More...

#include <NvInferRuntimeBase.h>

Public Types

enum class  Severity : int32_t {
  kINTERNAL_ERROR = 0 , kERROR = 1 , kWARNING = 2 , kINFO = 3 ,
  kVERBOSE = 4
}
 The severity corresponding to a log message. More...
 

Public Member Functions

virtual void log (Severity severity, AsciiChar const *msg) noexcept=0
 A callback implemented by the application to handle logging messages;. More...
 
 ILogger ()=default
 
virtual ~ILogger ()=default
 

Detailed Description

Application-implemented logging interface for the builder, refitter and runtime.

The logger used to create an instance of IBuilder, IRuntime or IRefitter is used for all objects created through that interface. The logger must be valid until all objects created are released.

The Logger object implementation must be thread safe. All locking and synchronization is pushed to the interface implementation and TensorRT does not hold any synchronization primitives when calling the interface functions.

Member Enumeration Documentation

◆ Severity

enum class nvinfer1::ILogger::Severity : int32_t
strong

The severity corresponding to a log message.

Enumerator
kINTERNAL_ERROR 

An internal error has occurred. Execution is unrecoverable.

kERROR 

An application error has occurred.

kWARNING 

An application error has been discovered, but TensorRT has recovered or fallen back to a default.

kINFO 

Informational messages with instructional information.

kVERBOSE 

Verbose messages with debugging information.

Constructor & Destructor Documentation

◆ ILogger()

nvinfer1::ILogger::ILogger ( )
default

◆ ~ILogger()

virtual nvinfer1::ILogger::~ILogger ( )
virtualdefault

Member Function Documentation

◆ log()

virtual void nvinfer1::ILogger::log ( Severity  severity,
AsciiChar const *  msg 
)
pure virtualnoexcept

A callback implemented by the application to handle logging messages;.

Parameters
severityThe severity of the message.
msgA null-terminated log message.
Warning
Loggers used in the safety certified runtime must set a maximum message length and truncate messages exceeding this length. It is up to the implementer of the derived class to define a suitable limit that will prevent buffer overruns, resource exhaustion, and other security vulnerabilities in their implementation. The TensorRT safety certified runtime will never emit messages longer than 1024 bytes.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime, or if the same logger is used for multiple runtimes, builders, or refitters.

The documentation for this class was generated from the following file:

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact