mirror of
https://github.com/DanielSWolf/rhubarb-lip-sync.git
synced 2026-11-21 12:25:08 +00:00
Refactoring: split logging code into individual files
This commit is contained in:
18
src/logging/formatters.cpp
Normal file
18
src/logging/formatters.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "formatters.h"
|
||||
#include <format.h>
|
||||
#include "Entry.h"
|
||||
#include "tools.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace logging {
|
||||
|
||||
string SimpleConsoleFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1}", entry.level, entry.message);
|
||||
}
|
||||
|
||||
string SimpleFileFormatter::format(const Entry& entry) {
|
||||
return fmt::format("[{0}] {1} {2}", formatTime(entry.timestamp, "%F %H:%M:%S"), entry.threadCounter, consoleFormatter.format(entry));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user