This commit is contained in:
Aaron Po
2026-05-15 14:11:34 -04:00
parent e6a20324e4
commit c58e4c1986
7 changed files with 24 additions and 44 deletions

View File

@@ -3,6 +3,8 @@
* @brief LogProducer implementation for asynchronous pipeline logging.
*/
#include "services/logging/log_producer.h"
#include <chrono>
#include <optional>
#include <string>
@@ -10,15 +12,13 @@
#include "concurrency/bounded_channel.h"
#include "services/logging/log_entry.h"
#include "services/logging/log_producer.h"
LogProducer::LogProducer(BoundedChannel<LogEntry>& channel)
: channel_(channel) {}
void LogProducer::Log(LogLevel level, PipelinePhase phase,
const std::string_view message) {
const std::string_view message) {
channel_.Send(LogEntry{.timestamp = std::chrono::system_clock::now(),
.calling_thread_id = std::this_thread::get_id(),
.level = level,
.phase = phase,
.message = std::string(message)});