mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
41 lines
966 B
C++
41 lines
966 B
C++
/**
|
|
* @file services/logging/log_entry.h
|
|
* @brief POD struct representing a single log event in the pipeline.
|
|
*
|
|
* LogEntry is produced by PipelineLogger and consumed by LogWorker via
|
|
* BoundedChannel<LogEntry>. All fields are value types so entries are
|
|
* safely movable across the channel without shared ownership.
|
|
*/
|
|
|
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_ENTRY_H_
|
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_ENTRY_H_
|
|
|
|
#include <chrono>
|
|
#include <string>
|
|
|
|
enum class LogLevel {
|
|
Debug,
|
|
Info,
|
|
Warn,
|
|
Error,
|
|
};
|
|
|
|
enum class PipelinePhase {
|
|
Startup,
|
|
UserGeneration,
|
|
BreweryAndBeerGeneration,
|
|
CheckinGeneration,
|
|
RatingGeneration,
|
|
FollowGeneration,
|
|
Teardown,
|
|
};
|
|
|
|
struct LogEntry {
|
|
std::chrono::system_clock::time_point timestamp =
|
|
std::chrono::system_clock::now();
|
|
LogLevel level;
|
|
PipelinePhase phase;
|
|
std::string message;
|
|
};
|
|
|
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_LOGGING_LOG_ENTRY_H_
|