/** * @file services/logging/channel_logger.h * @brief Channel-backed implementation of the Logger interface. * * ChannelLogger constructs LogEntry values and forwards them to a * BoundedChannel for asynchronous consumption by LogConsumer. * The channel is injected by reference; ChannelLogger does not own it. */ #ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_ #define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_ #include #include "concurrency/bounded_channel.h" #include "services/logging/log_entry.h" #include "services/logging/logger.h" class ChannelLogger final : public ILogger { public: explicit ChannelLogger(BoundedChannel& channel); ChannelLogger(const ChannelLogger&) = delete; ChannelLogger& operator=(const ChannelLogger&) = delete; ChannelLogger(ChannelLogger&&) = delete; ChannelLogger& operator=(ChannelLogger&&) = delete; ~ChannelLogger() override = default; void Log(LogLevel level, PipelinePhase phase, std::string_view message) override; private: BoundedChannel& channel_; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_