mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-04-08 01:57:30 +08:00
feat(logger): add logger manager to provide unified logging (#1267)
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user