add some app infrastructure services

This commit is contained in:
2026-06-07 15:49:43 -05:00
parent 1eb62ed186
commit 30b06e077c
10 changed files with 328 additions and 11 deletions

View File

@@ -0,0 +1,46 @@
#pragma once
#include <vector>
#include <string>
#include <fstream>
#include <source_location>
#include "ConfigService.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:
bool standardOutputEnabled_;
bool fileOutputEnabled_;
bool additionaldetailsEnabled_;
bool timeEnabled_;
std::ofstream outfile_;
std::string id_;
std::vector<LogFlag> activeFlags_;
LoggerConfig configuration_;
};