NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::ILogger Class Referenceabstract

Logger interface class. More...

#include <nvneural/CoreTypes.h>

Inheritance diagram for nvneural::ILogger:
nvneural::IRefObject nvneural::BufferedLogger

Public Types

using VerbosityLevel = std::int32_t
 Typedef for verbosity levels. More...
 
- Public Types inherited from nvneural::IRefObject
using RefCount = std::uint32_t
 Typedef used to track the number of active references to an object.
 
using TypeId = std::uint64_t
 Every interface must define a unique TypeId. This should be randomized.
 

Public Member Functions

virtual NeuralResult log (VerbosityLevel verbosity, const char *format,...) noexcept=0
 Logs an informational message. More...
 
virtual NeuralResult logError (VerbosityLevel verbosity, const char *format,...) noexcept=0
 Logs an error message. More...
 
virtual NeuralResult logWarning (VerbosityLevel verbosity, const char *format,...) noexcept=0
 Logs a warning message. More...
 
virtual VerbosityLevel verbosity () const noexcept=0
 Retrieves the current verbosity level. More...
 
- Public Member Functions inherited from nvneural::IRefObject
virtual RefCount addRef () const noexcept=0
 Increments the object's reference count. More...
 
virtual const void * queryInterface (TypeId interface) const noexcept=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual void * queryInterface (TypeId interface) noexcept=0
 Retrieves a new object interface pointer. More...
 
virtual RefCount release () const noexcept=0
 Decrements the object's reference count and destroy the object if the reference count reaches zero. More...
 

Static Public Attributes

static const IRefObject::TypeId typeID = 0xd74335d06aa1ba61ul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IRefObject
static const TypeId typeID = 0x14ecc3f9de638e1dul
 Interface TypeId for InterfaceOf purposes.
 

Additional Inherited Members

- Protected Member Functions inherited from nvneural::IRefObject
virtual ~IRefObject ()=default
 A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
 

Detailed Description

Logger interface class.

All plugins should log to this class instead of other destinations such as files or stdout.

Most logger parameters are set by the owning tool or application and are thus not changeable from this interface.

Member Typedef Documentation

◆ VerbosityLevel

using nvneural::ILogger::VerbosityLevel = std::int32_t

Typedef for verbosity levels.

Higher values indicate lower importance.

As a general rule, important messages should use 0, debugging messages should use 1, and verbose debugging messages (object ctor/dtor tracing, for example) should use 2 or higher.

Member Function Documentation

◆ log()

virtual NeuralResult nvneural::ILogger::log ( VerbosityLevel  verbosity,
const char *  format,
  ... 
)
pure virtualnoexcept

Logs an informational message.

Parameters
verbosityVerbosity level of the message.
formatPrintf-style format string.
Note
If verbosity is higher than the current verbosity level, this function may exit silently with a successful result.

Implemented in nvneural::BufferedLogger.

◆ logError()

virtual NeuralResult nvneural::ILogger::logError ( VerbosityLevel  verbosity,
const char *  format,
  ... 
)
pure virtualnoexcept

Logs an error message.

Error messages indicate a serious failure has occurred and the user's workflow must stop. Recoverable or expected failures should probably be warnings, not errors.

Under normal conditions, plugins should not emit error messages at verbosity level 0.

Error messages do not necessarily have to be fatal errors and result in application exit; a failure to export a model because of insufficient disk space is a legitimate error message but would not require the model editor to exit.

Parameters
verbosityVerbosity level of the message.
formatPrintf-style format string.
Note
If verbosity is higher than the current verbosity level, this function may exit silently with a successful result.

Implemented in nvneural::BufferedLogger.

◆ logWarning()

virtual NeuralResult nvneural::ILogger::logWarning ( VerbosityLevel  verbosity,
const char *  format,
  ... 
)
pure virtualnoexcept

Logs a warning message.

Warning messages indicate transient failures that the user should be aware of, but which did not result in failure of a major operation.

Under normal conditions, plugins should not emit warning messages at verbosity level 0.

Parameters
verbosityVerbosity level of the message.
formatPrintf-style format string.
Note
If verbosity is higher than the current verbosity level, this function may exit silently with a successful result.

Implemented in nvneural::BufferedLogger.

◆ verbosity()

virtual VerbosityLevel nvneural::ILogger::verbosity ( ) const
pure virtualnoexcept

Retrieves the current verbosity level.

Note
You should not need this function under normal circumstances. The normal log methods will exit early when logging more verbosely than the application demands. This function exists to allow you to skip expensive formatting operations (string allocations, etc.) that must be performed for the log methods' printf formatting interface.

Implemented in nvneural::BufferedLogger.


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