NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
nvsipl::INvSIPLDeviceBlockTrace Class Referenceabstract

Detailed Description

Describes the interfaces of NvSIPLDeviceBlockTrace.

Defines the public interfaces to control the logging/tracing of the NvSIPL Device Block Trace for debug purposes.

Definition at line 45 of file NvSIPLDeviceBlockTrace.hpp.

Public Types

enum  TraceLevel : std::uint8_t {
  TraceLevel::LevelNone = 0,
  TraceLevel::LevelError,
  TraceLevel::LevelWarning,
  TraceLevel::LevelInfo,
  TraceLevel::LevelDebug
}
 Defines tracing/logging levels. More...
 
using TraceFuncPtr = void(*)(const char *, int)
 

Public Member Functions

virtual void SetHook (TraceFuncPtr traceHook, bool const bCallDefaultRenderer)=0
 Sets a callable trace hook. More...
 
virtual void SetLevel (TraceLevel const eLevel)=0
 Sets the log level. More...
 
virtual TraceLevel GetLevel ()=0
 Gets the log level. More...
 
virtual void DisableLineInfo (void)=0
 Disable line info (FUNCTION : LINE: ) prefix. More...
 
virtual void Trace (TraceLevel eLevel, const char *func, const char *file, int line, const char *pformat,...)=0
 Log a trace message. More...
 
virtual ~INvSIPLDeviceBlockTrace ()=default
 (NV_IS_SAFETY) More...
 

Static Public Member Functions

static INvSIPLDeviceBlockTraceGetInstance (void)
 Gets a handle to INvSIPLDeviceBlockTrace instance. More...
 

Protected Member Functions

 INvSIPLDeviceBlockTrace ()=default
 Default constructor. More...
 
 INvSIPLDeviceBlockTrace (INvSIPLDeviceBlockTrace const &)=delete
 Default INvSIPLDeviceBlockTrace copy assignment operator. More...
 
 INvSIPLDeviceBlockTrace (INvSIPLDeviceBlockTrace &&)=delete
 Default INvSIPLDeviceBlockTrace move assignment operator. More...
 
INvSIPLDeviceBlockTraceoperator= (INvSIPLDeviceBlockTrace const &) &=delete
 Default INvSIPLDeviceBlockTrace copy assignment operator. More...
 
INvSIPLDeviceBlockTraceoperator= (INvSIPLDeviceBlockTrace &&) &=delete
 Default INvSIPLDeviceBlockTrace from move assignment operator. More...
 

Member Typedef Documentation

◆ TraceFuncPtr

Definition at line 76 of file NvSIPLDeviceBlockTrace.hpp.

Member Enumeration Documentation

◆ TraceLevel

enum nvsipl::INvSIPLDeviceBlockTrace::TraceLevel : std::uint8_t
strong

Defines tracing/logging levels.

Enumerator
LevelNone 

Indicates logging is turned off.

LevelError 

Indicates logging is turned on for errors.

LevelWarning 

Indicates logging is turned on for critical warnings.

LevelInfo 

Indicates logging is turned on for information level messages.

LevelDebug 

Indicates logging is turned on for every print statement.

Definition at line 50 of file NvSIPLDeviceBlockTrace.hpp.

Constructor & Destructor Documentation

◆ ~INvSIPLDeviceBlockTrace()

virtual nvsipl::INvSIPLDeviceBlockTrace::~INvSIPLDeviceBlockTrace ( )
virtualdefault

(NV_IS_SAFETY)

Default destructor.

◆ INvSIPLDeviceBlockTrace() [1/3]

nvsipl::INvSIPLDeviceBlockTrace::INvSIPLDeviceBlockTrace ( )
protecteddefault

Default constructor.

◆ INvSIPLDeviceBlockTrace() [2/3]

nvsipl::INvSIPLDeviceBlockTrace::INvSIPLDeviceBlockTrace ( INvSIPLDeviceBlockTrace const &  )
protecteddelete

Default INvSIPLDeviceBlockTrace copy assignment operator.

◆ INvSIPLDeviceBlockTrace() [3/3]

nvsipl::INvSIPLDeviceBlockTrace::INvSIPLDeviceBlockTrace ( INvSIPLDeviceBlockTrace &&  )
protecteddelete

Default INvSIPLDeviceBlockTrace move assignment operator.

Member Function Documentation

◆ DisableLineInfo()

virtual void nvsipl::INvSIPLDeviceBlockTrace::DisableLineInfo ( void  )
pure virtual

Disable line info (FUNCTION : LINE: ) prefix.

Function to disable line information prefix. Each log/trace is prefixed with function name and the line number. Calling this function will disable the prefix.

Precondition
None.

◆ GetInstance()

static INvSIPLDeviceBlockTrace* nvsipl::INvSIPLDeviceBlockTrace::GetInstance ( void  )
static

Gets a handle to INvSIPLDeviceBlockTrace instance.

Static function to get a handle to singleton INvSIPLDeviceBlockTrace implementation object.

Note
On safety build, this function always returns NULL.
Precondition
None.
Return values
(INvSIPLDeviceBlockTrace*)Pointer to INvSIPLDeviceBlockTrace.

◆ GetLevel()

virtual TraceLevel nvsipl::INvSIPLDeviceBlockTrace::GetLevel ( )
pure virtual

Gets the log level.

Function to fetch the level of logging.

Precondition
None.
Return values
(TraceLevel)Level of logging.

◆ operator=() [1/2]

INvSIPLDeviceBlockTrace& nvsipl::INvSIPLDeviceBlockTrace::operator= ( INvSIPLDeviceBlockTrace &&  ) &
protecteddelete

Default INvSIPLDeviceBlockTrace from move assignment operator.

◆ operator=() [2/2]

INvSIPLDeviceBlockTrace& nvsipl::INvSIPLDeviceBlockTrace::operator= ( INvSIPLDeviceBlockTrace const &  ) &
protecteddelete

Default INvSIPLDeviceBlockTrace copy assignment operator.

◆ SetHook()

virtual void nvsipl::INvSIPLDeviceBlockTrace::SetHook ( TraceFuncPtr  traceHook,
bool const  bCallDefaultRenderer 
)
pure virtual

Sets a callable trace hook.

Function to set a callable hook to receive the messages from the library.

Precondition
None.
Parameters
[in]traceHookstd::function object, which could be a functor, function pointer, or a lambda. The function object must include const char* message and number of chars as arguments.
[in]bCallDefaultRendererBoolean flag indicating if the message should be printed to the default renderer (stderr).

◆ SetLevel()

virtual void nvsipl::INvSIPLDeviceBlockTrace::SetLevel ( TraceLevel const  eLevel)
pure virtual

Sets the log level.

Function to set the level of logging. Each trace statement specifies a trace level for that statement, and all traces with a level greater than or equal to the current application trace level will be rendered at runtime. Traces with a level below the application trace level will be ignored. The application trace level can be changed at any time to render additional or fewer trace statements.

Precondition
None.
Parameters
[in]eLevelTrace level TraceLevel.

◆ Trace()

virtual void nvsipl::INvSIPLDeviceBlockTrace::Trace ( TraceLevel  eLevel,
const char *  func,
const char *  file,
int  line,
const char *  pformat,
  ... 
)
pure virtual

Log a trace message.

Function to log a trace message.

Precondition
None.
Parameters
[in]eLevelLevel to log the trace at.
[in]funcFunction name.
[in]fileFile name.
[in]lineLine number.
[in]pformatFormat string.
[in]...Variadic list of arguments corresponding to the format string.

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