Class DataLogger
Defined in File data_logger.hpp
Derived Type
public holoscan::DataLoggerResource
(Class DataLoggerResource)
-
class DataLogger
Pure virtual interface for data loggers.
This interface defines the contract that all data loggers must implement for logging various types of data including generic std::any data, Tensors, and TensorMaps.
Subclassed by holoscan::DataLoggerResource
Public Functions
-
DataLogger() = default
-
virtual ~DataLogger() = default
Logs a message.
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 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 (including serialization and sending) was successful, false otherwise.
Logs a Tensor with optional data content logging.
This specialized method allows efficient logging of tensor metadata without the overhead of logging large tensor data arrays when only header information is needed.
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
tensor – The Tensor to log.
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 otherwise.
Logs a TensorMap with optional data content logging.
This specialized method allows efficient logging of tensor map metadata without the overhead of logging large tensor data arrays when only header information is needed.
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
tensor_map – The TensorMap to log.
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 otherwise.
-
virtual bool should_log_output() const = 0
Checks if the logger should log output ports.
If False, the data logger will not be applied during op_output.emit() calls from Operator::compute.
- Returns
true if the logger should log output ports, false otherwise.
-
virtual bool should_log_input() const = 0
Checks if the logger should log input ports.
If False, the data logger will not be applied during op_input.receive() calls from Operator::compute.
- Returns
true if the logger should log input ports, false otherwise.
-
DataLogger() = default