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 INvSIPLDeviceBlockTrace * | GetInstance (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... | |
INvSIPLDeviceBlockTrace & | operator= (INvSIPLDeviceBlockTrace const &) &=delete |
Default INvSIPLDeviceBlockTrace copy assignment operator. More... | |
INvSIPLDeviceBlockTrace & | operator= (INvSIPLDeviceBlockTrace &&) &=delete |
Default INvSIPLDeviceBlockTrace from move assignment operator. More... | |
using nvsipl::INvSIPLDeviceBlockTrace::TraceFuncPtr = void(*)(const char*, int) |
Definition at line 76 of file NvSIPLDeviceBlockTrace.hpp.
|
strong |
Defines tracing/logging levels.
Definition at line 50 of file NvSIPLDeviceBlockTrace.hpp.
|
virtualdefault |
(NV_IS_SAFETY)
Default destructor.
|
protecteddefault |
Default constructor.
|
protecteddelete |
Default INvSIPLDeviceBlockTrace copy assignment operator.
|
protecteddelete |
Default INvSIPLDeviceBlockTrace move assignment operator.
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.
|
static |
Gets a handle to INvSIPLDeviceBlockTrace instance.
Static function to get a handle to singleton INvSIPLDeviceBlockTrace implementation object.
(INvSIPLDeviceBlockTrace*) | Pointer to INvSIPLDeviceBlockTrace. |
|
pure virtual |
Gets the log level.
Function to fetch the level of logging.
(TraceLevel) | Level of logging. |
|
protecteddelete |
Default INvSIPLDeviceBlockTrace from move assignment operator.
|
protecteddelete |
Default INvSIPLDeviceBlockTrace copy assignment operator.
|
pure virtual |
Sets a callable trace hook.
Function to set a callable hook to receive the messages from the library.
[in] | traceHook | std::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] | bCallDefaultRenderer | Boolean flag indicating if the message should be printed to the default renderer (stderr). |
|
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.
[in] | eLevel | Trace level TraceLevel. |
|
pure virtual |
Log a trace message.
Function to log a trace message.
[in] | eLevel | Level to log the trace at. |
[in] | func | Function name. |
[in] | file | File name. |
[in] | line | Line number. |
[in] | pformat | Format string. |
[in] | ... | Variadic list of arguments corresponding to the format string. |