updated logger to support std::format (upgrading to gcc >13 was one of the most tedious things i've ever done)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <source_location>
|
||||
#include <format>
|
||||
|
||||
#include "config/ConfigService.hpp"
|
||||
#include "config/LoggerConfig.hpp"
|
||||
@@ -30,7 +31,10 @@ 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>
|
||||
template<typename... Args>
|
||||
void log(std::string component, LogFlag flag, std::format_string<Args...> message, Args&&... args) {
|
||||
write(component, flag, std::format(message, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -38,4 +42,6 @@ private:
|
||||
std::vector<LogFlag> activeFlags_;
|
||||
|
||||
LoggerParams configuration_;
|
||||
|
||||
void write(std::string component, LogFlag flag, std::string message);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user