NVIDIA Holoscan SDK v3.5.0

Class GXFConsoleLogger

Base Type

class GXFConsoleLogger : public holoscan::data_loggers::BasicConsoleLogger

GXF-specific extension of BasicConsoleLogger with support for GXF Entity logging.

This logger extends BasicConsoleLogger to provide support for logging GXF-specific data types, particularly nvidia::gxf::Entity and holoscan::gxf::Entity objects. It implements the log_backend_specific method to handle these GXF entity types with appropriate runtime type checking. Currently only Tensor components present within the entity will be logged.

All the same parameters from BasicConsoleLogger are supported. See BasicConsoleLogger documentation for parameter details.

Public Functions

HOLOSCAN_RESOURCE_FORWARD_ARGS_SUPER (GXFConsoleLogger, BasicConsoleLogger) GXFConsoleLogger()=default
virtual bool log_backend_specific(const std::any &data, const std::string &unique_id, int64_t acquisition_timestamp = -1, const std::shared_ptr<MetadataDictionary> &metadata = nullptr, IOSpec::IOType io_type = IOSpec::IOType::kOutput) override

Logs backend-specific data types.

This method is called for logging backend-specific data types (intended for use with backends that have separate emit/receive codepaths for backend-specific types). The data parameter is kept as std::any here to avoid making the base interface specific to a particular backend, but a backend-specific concrete implementation should be provided as needed via run-time type checking.

A concrete example of a backend-specific type is the GXF Entity type which is a heterogeneous collection of components. An implementation of this method for GXF entities is provided in the concrete implementation of the GXFConsoleLogger.

The unique_id for the message will have the form:

  • operator_name.port_name

  • operator_name.port_name:index (for multi-receivers with N:1 connection)

For distributed applications, the fragment name will also appear in the unique id:

  • fragment_name.operator_name.port_name

  • fragment_name.operator_name.port_name:index

Parameters
  • data – The backend-specific data to log, passed as std::any.

  • unique_id – A unique identifier for the message.

  • acquisition_timestamp – Timestamp when the data was acquired (-1 if unknown).

  • metadata – Associated metadata dictionary for the message.

  • io_type – The type of I/O port (kInput or kOutput).

Returns

true if logging was successful, false if backend-specific logging is not supported.

Previous Class BasicConsoleLogger
Next Class SimpleTextSerializer
© Copyright 2022-2025, NVIDIA. Last updated on Aug 1, 2025.