scaffold some common services

This commit is contained in:
2026-07-16 22:58:57 -05:00
parent 13bfbd3479
commit 3a3f67c4ef
22 changed files with 427 additions and 22 deletions

41
common/LoggerService.hpp Normal file
View File

@@ -0,0 +1,41 @@
#pragma once
#include <vector>
#include <string>
#include <fstream>
#include <source_location>
#include "config/ConfigService.hpp"
#include "config/LoggerConfig.hpp"
enum LogFlag {
Debug,
Info,
Warning,
Error,
Count
};
static constexpr const char* LogFlagStrings[] = {
"Debug",
"Info",
"Warning",
"Error"
};
class LoggerService {
public:
LoggerService(ConfigService* config, const std::string& loggerId);
~LoggerService();
void log(std::string component, LogFlag flag, std::string message, std::source_location Source = std::source_location::current()); // Using the <source_location>
private:
std::ofstream outfile_;
std::vector<LogFlag> activeFlags_;
LoggerParams configuration_;
};