mirror of
https://github.com/hyprwm/hyprutils.git
synced 2024-11-17 06:05:59 +01:00
Path: use log level LOG
This commit is contained in:
parent
360fb14385
commit
82816f0a77
1 changed files with 7 additions and 7 deletions
|
@ -18,7 +18,7 @@ namespace Hyprutils::Path {
|
||||||
static const auto homeDir = getenv("HOME");
|
static const auto homeDir = getenv("HOME");
|
||||||
|
|
||||||
if (!homeDir || !std::filesystem::path(homeDir).is_absolute()) {
|
if (!homeDir || !std::filesystem::path(homeDir).is_absolute()) {
|
||||||
Debug::log(INFO, "'$HOME' is either not found or not an absolute path");
|
Debug::log(LOG, "'$HOME' is either not found or not an absolute path");
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace Hyprutils::Path {
|
||||||
static const auto xdgConfigDirs = getenv("XDG_CONFIG_DIRS");
|
static const auto xdgConfigDirs = getenv("XDG_CONFIG_DIRS");
|
||||||
|
|
||||||
if (!xdgConfigDirs) {
|
if (!xdgConfigDirs) {
|
||||||
Debug::log(INFO, "'$XDG_CONFIG_DIRS' is not set");
|
Debug::log(LOG, "'$XDG_CONFIG_DIRS' is not set");
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ namespace Hyprutils::Path {
|
||||||
static const auto xdgConfigHome = getenv("XDG_CONFIG_HOME");
|
static const auto xdgConfigHome = getenv("XDG_CONFIG_HOME");
|
||||||
|
|
||||||
if (!xdgConfigHome || !std::filesystem::path(xdgConfigHome).is_absolute()) {
|
if (!xdgConfigHome || !std::filesystem::path(xdgConfigHome).is_absolute()) {
|
||||||
Debug::log(INFO, "'$XDG_CONFIG_HOME' is either not found or not an absolute path");
|
Debug::log(LOG, "'$XDG_CONFIG_HOME' is either not found or not an absolute path");
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ namespace Hyprutils::Path {
|
||||||
configPath = fullConfigPath(xdgConfigHome.value(), programName);
|
configPath = fullConfigPath(xdgConfigHome.value(), programName);
|
||||||
if (std::filesystem::exists(configPath))
|
if (std::filesystem::exists(configPath))
|
||||||
return std::make_pair(configPath, xdgConfigHome);
|
return std::make_pair(configPath, xdgConfigHome);
|
||||||
Debug::log(INFO, "No config file {}", configPath);
|
Debug::log(LOG, "No config file {}", configPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool homeExists = false;
|
bool homeExists = false;
|
||||||
|
@ -70,7 +70,7 @@ namespace Hyprutils::Path {
|
||||||
configPath = fullConfigPath(home.value(), programName);
|
configPath = fullConfigPath(home.value(), programName);
|
||||||
if (std::filesystem::exists(configPath))
|
if (std::filesystem::exists(configPath))
|
||||||
return std::make_pair(configPath, home);
|
return std::make_pair(configPath, home);
|
||||||
Debug::log(INFO, "No config file {}", configPath);
|
Debug::log(LOG, "No config file {}", configPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const auto xdgConfigDirs = getXdgConfigDirs();
|
static const auto xdgConfigDirs = getXdgConfigDirs();
|
||||||
|
@ -79,14 +79,14 @@ namespace Hyprutils::Path {
|
||||||
configPath = fullConfigPath(dir, programName);
|
configPath = fullConfigPath(dir, programName);
|
||||||
if (std::filesystem::exists(configPath))
|
if (std::filesystem::exists(configPath))
|
||||||
return std::make_pair(configPath, std::nullopt);
|
return std::make_pair(configPath, std::nullopt);
|
||||||
Debug::log(INFO, "No config file {}", configPath);
|
Debug::log(LOG, "No config file {}", configPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configPath = fullConfigPath("/etc/xdg", programName);
|
configPath = fullConfigPath("/etc/xdg", programName);
|
||||||
if (std::filesystem::exists(configPath))
|
if (std::filesystem::exists(configPath))
|
||||||
return std::make_pair(configPath, std::nullopt);
|
return std::make_pair(configPath, std::nullopt);
|
||||||
Debug::log(INFO, "No config file {}", configPath);
|
Debug::log(LOG, "No config file {}", configPath);
|
||||||
|
|
||||||
if (xdgConfigHomeExists)
|
if (xdgConfigHomeExists)
|
||||||
return std::make_pair(std::nullopt, xdgConfigHome);
|
return std::make_pair(std::nullopt, xdgConfigHome);
|
||||||
|
|
Loading…
Reference in a new issue