Class LogSource

Inheritance Relationships

Derived Type

Class Documentation

class LogSource

Port: source of /rosout-like log entries. The adapter (Ros2LogSource) subscribes to /rosout and delivers each message as a neutral LogEntry, normalising logger name (no leading slash) and SOVD severity. Manager keeps the ring-buffer storage; the source merely produces entries.

Naming note: this port is named LogSource rather than LogTransport (which would match the rest of core/transports/) because it is a one-way event emitter - the manager subscribes via a callback rather than driving requests through a bidirectional channel. The asymmetry is intentional; renaming to LogTransport was considered and rejected to preserve the “passive source” semantics the rcl_interfaces/Log subscription captures.

Subclassed by ros2_medkit_gateway::ros2::Ros2LogSource

Public Types

using EntryCallback = std::function<void(const LogEntry &entry)>

Public Functions

LogSource() = default
LogSource(const LogSource&) = delete
LogSource &operator=(const LogSource&) = delete
LogSource(LogSource&&) = delete
LogSource &operator=(LogSource&&) = delete
virtual ~LogSource() = default
virtual void start(EntryCallback callback) = 0

Start delivering entries. Idempotent. Calling start() twice replaces the previous callback.

virtual void stop() = 0

Stop delivering entries. Idempotent. After stop() returns, the callback is guaranteed not to fire again.