update doxygen comments for concurrent logger

This commit is contained in:
Aaron Po
2026-05-14 21:21:28 -04:00
parent 74f11b57e2
commit a4968eb043
6 changed files with 161 additions and 88 deletions

View File

@@ -1,10 +1,9 @@
/**
* @file services/logging/channel_logger.h
* @brief Channel-backed implementation of the Logger interface.
* @brief Channel-backed producer for asynchronous pipeline logging.
*
* ChannelLogger constructs LogEntry values and forwards them to a
* BoundedChannel<LogEntry> for asynchronous consumption by LogConsumer.
* The channel is injected by reference; ChannelLogger does not own it.
* Intent: Decouple logging from synchronous I/O by forwarding entries to a
* bounded channel. LogConsumer drains the channel on a dedicated thread.
*/
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_
@@ -16,22 +15,40 @@
#include "services/logging/log_entry.h"
#include "services/logging/logger.h"
/**
* @class ChannelLogger
* @brief ILogger implementation that sends entries to a BoundedChannel.
*
* Non-copyable, non-movable. Holds a non-owning reference to the channel.
*/
class ChannelLogger final : public ILogger {
public:
explicit ChannelLogger(BoundedChannel<LogEntry>& channel);
/**
* @brief Construct a channel-backed logger.
*
* @param channel Reference to bounded channel for log entry transfer.
* Channel must outlive this logger instance.
*/
explicit ChannelLogger(BoundedChannel<LogEntry>& channel);
ChannelLogger(const ChannelLogger&) = delete;
ChannelLogger& operator=(const ChannelLogger&) = delete;
ChannelLogger(ChannelLogger&&) = delete;
ChannelLogger& operator=(ChannelLogger&&) = delete;
ChannelLogger(const ChannelLogger&) = delete;
ChannelLogger& operator=(const ChannelLogger&) = delete;
ChannelLogger(ChannelLogger&&) = delete;
ChannelLogger& operator=(ChannelLogger&&) = delete;
~ChannelLogger() override = default;
~ChannelLogger() override = default;
void Log(LogLevel level, PipelinePhase phase,
std::string_view message) override;
/**
* @brief Queue a log entry for asynchronous processing.
*
* Blocks if the channel is full (backpressure). Returns immediately
* if the channel is closed.
*/
void Log(LogLevel level, PipelinePhase phase,
std::string_view message) override;
private:
BoundedChannel<LogEntry>& channel_;
BoundedChannel<LogEntry>& channel_;
};
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_CHANNEL_LOGGER_H_