From 6175ecd4c4ba817c4620f66a75e1e11da7c7a8ca Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 18 Dec 2025 17:23:24 +0000 Subject: debug: move to hyprutils' logger (#12673) --- src/helpers/fs/FsUtils.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/helpers/fs/FsUtils.cpp') diff --git a/src/helpers/fs/FsUtils.cpp b/src/helpers/fs/FsUtils.cpp index 0bc2e685..60af7d44 100644 --- a/src/helpers/fs/FsUtils.cpp +++ b/src/helpers/fs/FsUtils.cpp @@ -1,8 +1,9 @@ #include "FsUtils.hpp" -#include "../../debug/Log.hpp" +#include "../../debug/log/Logger.hpp" #include #include +#include #include #include @@ -17,7 +18,7 @@ std::optional NFsUtils::getDataHome() { const auto HOME = getenv("HOME"); if (!HOME) { - Debug::log(ERR, "FsUtils::getDataHome: can't get data home: no $HOME or $XDG_DATA_HOME"); + Log::logger->log(Log::ERR, "FsUtils::getDataHome: can't get data home: no $HOME or $XDG_DATA_HOME"); return std::nullopt; } @@ -27,26 +28,26 @@ std::optional NFsUtils::getDataHome() { std::error_code ec; if (!std::filesystem::exists(dataRoot, ec) || ec) { - Debug::log(ERR, "FsUtils::getDataHome: can't get data home: inaccessible / missing"); + Log::logger->log(Log::ERR, "FsUtils::getDataHome: can't get data home: inaccessible / missing"); return std::nullopt; } dataRoot += "hyprland/"; if (!std::filesystem::exists(dataRoot, ec) || ec) { - Debug::log(LOG, "FsUtils::getDataHome: no hyprland data home, creating."); + Log::logger->log(Log::DEBUG, "FsUtils::getDataHome: no hyprland data home, creating."); std::filesystem::create_directory(dataRoot, ec); if (ec) { - Debug::log(ERR, "FsUtils::getDataHome: can't create new data home for hyprland"); + Log::logger->log(Log::ERR, "FsUtils::getDataHome: can't create new data home for hyprland"); return std::nullopt; } std::filesystem::permissions(dataRoot, std::filesystem::perms::owner_read | std::filesystem::perms::owner_write | std::filesystem::perms::owner_exec, ec); if (ec) - Debug::log(WARN, "FsUtils::getDataHome: couldn't set perms on hyprland data store. Proceeding anyways."); + Log::logger->log(Log::WARN, "FsUtils::getDataHome: couldn't set perms on hyprland data store. Proceeding anyways."); } if (!std::filesystem::exists(dataRoot, ec) || ec) { - Debug::log(ERR, "FsUtils::getDataHome: no hyprland data home, failed to create."); + Log::logger->log(Log::ERR, "FsUtils::getDataHome: no hyprland data home, failed to create."); return std::nullopt; } @@ -69,7 +70,7 @@ std::optional NFsUtils::readFileAsString(const std::string& path) { bool NFsUtils::writeToFile(const std::string& path, const std::string& content) { std::ofstream of(path, std::ios::trunc); if (!of.good()) { - Debug::log(ERR, "CVersionKeeperManager: couldn't open an ofstream for writing the version file."); + Log::logger->log(Log::ERR, "CVersionKeeperManager: couldn't open an ofstream for writing the version file."); return false; } -- cgit v1.2.3