mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
Implement BoundedChannel and multithreaded logging infra
This commit is contained in:
45
tooling/pipeline/includes/services/logging/logger.h
Normal file
45
tooling/pipeline/includes/services/logging/logger.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file services/logging/logger.h
|
||||
* @brief Abstract logging interface for pipeline components.
|
||||
*
|
||||
* Intent: Decouple logging from channel/worker implementation details.
|
||||
* All pipeline components depend on ILogger, enabling swappable backends.
|
||||
*/
|
||||
|
||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOGGER_H_
|
||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOGGER_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "services/logging/log_entry.h"
|
||||
|
||||
/**
|
||||
* @class ILogger
|
||||
* @brief Minimal interface for submitting log entries.
|
||||
*
|
||||
* Non-copyable and non-movable. Implementations are typically short-lived,
|
||||
* created and owned by the composition root.
|
||||
*/
|
||||
class ILogger {
|
||||
public:
|
||||
ILogger() = default;
|
||||
ILogger(const ILogger&) = delete;
|
||||
ILogger& operator=(const ILogger&) = delete;
|
||||
ILogger(ILogger&&) = delete;
|
||||
ILogger& operator=(ILogger&&) = delete;
|
||||
virtual ~ILogger() = default;
|
||||
|
||||
/**
|
||||
* @brief Submit a log entry to the logging subsystem.
|
||||
*
|
||||
* @param level Log level (Debug, Info, Warn, Error).
|
||||
* @param phase Pipeline execution phase (Startup, Generation, Teardown, etc.).
|
||||
* @param message Log message text.
|
||||
*/
|
||||
virtual void Log(LogLevel level, PipelinePhase phase,
|
||||
std::string_view message) = 0;
|
||||
};
|
||||
|
||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOGGER_H_
|
||||
Reference in New Issue
Block a user