feat(logger): add logger manager to provide unified logging (#1267)

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
K4YT3X
2024-12-19 23:46:10 -05:00
committed by GitHub
parent b8eb6de59b
commit 6676cd2439
25 changed files with 384 additions and 352 deletions

View File

@@ -10,6 +10,8 @@
#include <spdlog/spdlog.h>
#include "logger_manager.h"
namespace video2x {
namespace fsutils {
@@ -20,7 +22,7 @@ static std::filesystem::path get_executable_directory() {
// Get the executable path, expanding the buffer if necessary
DWORD size = GetModuleFileNameW(NULL, filepath.data(), static_cast<DWORD>(filepath.size()));
if (size == 0) {
spdlog::error("Error getting executable path: {}", GetLastError());
logger()->error("Error getting executable path: {}", GetLastError());
return std::filesystem::path();
}
@@ -29,7 +31,7 @@ static std::filesystem::path get_executable_directory() {
filepath.resize(filepath.size() * 2);
size = GetModuleFileNameW(NULL, filepath.data(), static_cast<DWORD>(filepath.size()));
if (size == 0) {
spdlog::error("Error getting executable path: {}", GetLastError());
logger()->error("Error getting executable path: {}", GetLastError());
return std::filesystem::path();
}
}
@@ -44,7 +46,7 @@ static std::filesystem::path get_executable_directory() {
std::filesystem::path filepath = std::filesystem::read_symlink("/proc/self/exe", ec);
if (ec) {
spdlog::error("Error reading /proc/self/exe: {}", ec.message());
logger()->error("Error reading /proc/self/exe: {}", ec.message());
return std::filesystem::path();
}