mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
logging/format: use std::format_string to catch formatting string errors at compile time (#3377)
* fix(log): use constexpr format string * deprecate getFormat
This commit is contained in:
@@ -1097,7 +1097,7 @@ void CConfigManager::updateBlurredLS(const std::string& name, const bool forceBl
|
||||
for (auto& lsl : m->m_aLayerSurfaceLayers) {
|
||||
for (auto& ls : lsl) {
|
||||
if (BYADDRESS) {
|
||||
if (getFormat("0x{:x}", (uintptr_t)ls.get()) == matchName)
|
||||
if (std::format("0x{:x}", (uintptr_t)ls.get()) == matchName)
|
||||
ls->forceBlur = forceBlur;
|
||||
} else if (ls->szNamespace == matchName)
|
||||
ls->forceBlur = forceBlur;
|
||||
@@ -1206,7 +1206,7 @@ void CConfigManager::handleSource(const std::string& command, const std::string&
|
||||
|
||||
if (auto r = glob(absolutePath(rawpath, configCurrentPath).c_str(), GLOB_TILDE, nullptr, glob_buf.get()); r != 0) {
|
||||
parseError = std::format("source= globbing error: {}", r == GLOB_NOMATCH ? "found no match" : GLOB_ABORTED ? "read error" : "out of memory");
|
||||
Debug::log(ERR, parseError);
|
||||
Debug::log(ERR, "{}", parseError);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1942,7 +1942,7 @@ std::vector<SLayerRule> CConfigManager::getMatchingRules(SLayerSurface* pLS) {
|
||||
|
||||
for (auto& lr : m_dLayerRules) {
|
||||
if (lr.targetNamespace.find("address:0x") == 0) {
|
||||
if (getFormat("address:0x{:x}", (uintptr_t)pLS) != lr.targetNamespace)
|
||||
if (std::format("address:0x{:x}", (uintptr_t)pLS) != lr.targetNamespace)
|
||||
continue;
|
||||
} else {
|
||||
std::regex NSCHECK(lr.targetNamespace);
|
||||
|
Reference in New Issue
Block a user