Logger#

class EdgeLLMLogger : public nvinfer1::ILogger#

Enhanced Logger with automatic location tracking and nvinfer1 compatibility.

Features:

  • Automatic source location tracking (file:line:function)

  • Configurable formatting (timestamps, location info)

  • nvinfer1::ILogger interface for TensorRT integration

  • Multiple log levels with performance optimizations

Public Functions

EdgeLLMLogger() = default#
~EdgeLLMLogger() = default#
inline void log(
nvinfer1::ILogger::Severity severity,
char const *msg
) noexcept override#

nvinfer1::ILogger interface implementation for TensorRT integration

Parameters:
  • severity – Log severity level

  • msg – Log message

inline void logWithLocation(
nvinfer1::ILogger::Severity level,
std::string const &msg,
SourceLocation const &loc
)#

Core logging function with automatic location tracking and formatting.

Parameters:
  • level – Log severity level

  • msg – Log message

  • loc – Source location information

inline void debug(std::string const &msg, SourceLocation const &loc)#

Log debug message with location tracking.

Parameters:
  • msg – Log message

  • loc – Source location information

inline void info(std::string const &msg, SourceLocation const &loc)#

Log info message with location tracking.

Parameters:
  • msg – Log message

  • loc – Source location information

inline void warning(
std::string const &msg,
SourceLocation const &loc
)#

Log warning message with location tracking.

Parameters:
  • msg – Log message

  • loc – Source location information

inline void error(std::string const &msg, SourceLocation const &loc)#

Log error message with location tracking.

Parameters:
  • msg – Log message

  • loc – Source location information

inline void setLevel(nvinfer1::ILogger::Severity level)#

Set minimum logging level.

Parameters:

level – Minimum severity level to log

inline nvinfer1::ILogger::Severity getLevel() const#

Get current logging level.

Returns:

Current minimum severity level

inline void setShowTimestamp(bool show)#

Configure whether to show timestamps in log output.

Parameters:

show – true to show timestamps, false to hide

inline void setShowLocation(bool show)#

Configure whether to show location info in log output.

Parameters:

show – true to show location, false to hide

inline void setShowFunction(bool show)#

Configure whether to show function names in log output.

Parameters:

show – true to show function names, false to hide

class ScopedFunctionTracer#

RAII-based function tracer for automatic entry/exit logging.

Creates automatic log messages when entering and exiting a scope. Useful for tracing function execution flow.

Public Functions

inline ScopedFunctionTracer(
EdgeLLMLogger &logger,
char const *funcName,
SourceLocation const &loc
)#

Constructor that logs function entry.

Parameters:
  • logger – Logger instance to use

  • funcName – Name of the function being traced

  • loc – Source location information

inline ~ScopedFunctionTracer()#

Destructor that logs function exit.

struct SourceLocation#

Source code location information for automatic tracking.

Captures file, function, and line number information for logging.

Public Functions

inline SourceLocation(char const *f, char const *func, int32_t l)#

Constructor with manual location capture.

Parameters:
  • f – Source file path

  • func – Function name

  • l – Line number

Public Members

char const *file#

Source file path.

char const *function#

Function name.

int32_t lineNumber#

Line number.