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/layout/DwindleLayout.cpp | 12 ++++++------ src/layout/IHyprLayout.cpp | 16 ++++++++-------- src/layout/MasterLayout.cpp | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/layout') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index c78b6f28..70e2d6a0 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -118,7 +118,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SP pNode, bool PMONITOR = WS->m_monitor.lock(); if (!PMONITOR || !WS) { - Debug::log(ERR, "Orphaned Node {}!!", pNode); + Log::logger->log(Log::ERR, "Orphaned Node {}!!", pNode); return; } @@ -135,7 +135,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SP pNode, bool const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(g_pCompositor->getWorkspaceByID(pNode->workspaceID)); if (!validMapped(PWINDOW)) { - Debug::log(ERR, "Node {} holding invalid {}!!", pNode, PWINDOW); + Log::logger->log(Log::ERR, "Node {} holding invalid {}!!", pNode, PWINDOW); onWindowRemovedTiling(PWINDOW); return; } @@ -316,7 +316,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir } else OPENINGON = getFirstNodeOnWorkspace(pWindow->workspaceID()); - Debug::log(LOG, "OPENINGON: {}, Monitor: {}", OPENINGON, PMONITOR->m_id); + Log::logger->log(Log::DEBUG, "OPENINGON: {}, Monitor: {}", OPENINGON, PMONITOR->m_id); if (OPENINGON && OPENINGON->workspaceID != PNODE->workspaceID) { // special workspace handling @@ -489,7 +489,7 @@ void CHyprDwindleLayout::onWindowRemovedTiling(PHLWINDOW pWindow) { const auto PNODE = getNodeFromWindow(pWindow); if (!PNODE) { - Debug::log(ERR, "onWindowRemovedTiling node null?"); + Log::logger->log(Log::ERR, "onWindowRemovedTiling node null?"); return; } @@ -502,7 +502,7 @@ void CHyprDwindleLayout::onWindowRemovedTiling(PHLWINDOW pWindow) { const auto PPARENT = PNODE->pParent; if (!PPARENT) { - Debug::log(LOG, "Removing last node (dwindle)"); + Log::logger->log(Log::DEBUG, "Removing last node (dwindle)"); std::erase(m_dwindleNodesData, PNODE); return; } @@ -1015,7 +1015,7 @@ std::any CHyprDwindleLayout::layoutMessage(SLayoutMessageHeader header, std::str std::string direction = ARGS[1]; if (direction.empty()) { - Debug::log(ERR, "Expected direction for preselect"); + Log::logger->log(Log::ERR, "Expected direction for preselect"); return ""; } diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 73f9d853..8a33928b 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -24,7 +24,7 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) { const auto STOREDSIZE = HASPERSISTENTSIZE ? g_pConfigManager->getStoredFloatingSize(pWindow) : std::nullopt; if (STOREDSIZE.has_value()) { - Debug::log(LOG, "using stored size {}x{} for new window {}::{}", STOREDSIZE->x, STOREDSIZE->y, pWindow->m_class, pWindow->m_title); + Log::logger->log(Log::DEBUG, "using stored size {}x{} for new window {}::{}", STOREDSIZE->x, STOREDSIZE->y, pWindow->m_class, pWindow->m_title); pWindow->m_lastFloatingSize = STOREDSIZE.value(); } else if (desiredGeometry.width <= 5 || desiredGeometry.height <= 5) { const auto PMONITOR = pWindow->m_monitor.lock(); @@ -117,7 +117,7 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) { static auto PXWLFORCESCALEZERO = CConfigValue("xwayland:force_zero_scaling"); if (!PMONITOR) { - Debug::log(ERR, "{:m} has an invalid monitor in onWindowCreatedFloating!!!", pWindow); + Log::logger->log(Log::ERR, "{:m} has an invalid monitor in onWindowCreatedFloating!!!", pWindow); return; } @@ -248,7 +248,7 @@ void IHyprLayout::onBeginDragWindow() { // Window will be floating. Let's check if it's valid. It should be, but I don't like crashing. if (!validMapped(DRAGGINGWINDOW)) { - Debug::log(ERR, "Dragging attempted on an invalid window!"); + Log::logger->log(Log::ERR, "Dragging attempted on an invalid window!"); CKeybindManager::changeMouseBindMode(MBIND_INVALID); return; } @@ -745,7 +745,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { void IHyprLayout::changeWindowFloatingMode(PHLWINDOW pWindow) { if (pWindow->isFullscreen()) { - Debug::log(LOG, "changeWindowFloatingMode: fullscreen"); + Log::logger->log(Log::DEBUG, "changeWindowFloatingMode: fullscreen"); g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE); } @@ -864,7 +864,7 @@ void IHyprLayout::moveActiveWindow(const Vector2D& delta, PHLWINDOW pWindow) { return; if (!PWINDOW->m_isFloating) { - Debug::log(LOG, "Dwindle cannot move a tiled window in moveActiveWindow!"); + Log::logger->log(Log::DEBUG, "Dwindle cannot move a tiled window in moveActiveWindow!"); return; } @@ -970,7 +970,7 @@ Vector2D IHyprLayout::predictSizeForNewWindowFloating(PHLWINDOW pWindow) { // ge const auto STOREDSIZE = HASPERSISTENTSIZE ? g_pConfigManager->getStoredFloatingSize(pWindow) : std::nullopt; if (STOREDSIZE.has_value()) { - Debug::log(LOG, "using stored size {}x{} for new floating window {}::{}", STOREDSIZE->x, STOREDSIZE->y, pWindow->m_class, pWindow->m_title); + Log::logger->log(Log::DEBUG, "using stored size {}x{} for new floating window {}::{}", STOREDSIZE->x, STOREDSIZE->y, pWindow->m_class, pWindow->m_title); return STOREDSIZE.value(); } @@ -1008,14 +1008,14 @@ bool IHyprLayout::updateDragWindow() { if (g_pInputManager->m_dragThresholdReached) { if (WAS_FULLSCREEN) { - Debug::log(LOG, "Dragging a fullscreen window"); + Log::logger->log(Log::DEBUG, "Dragging a fullscreen window"); g_pCompositor->setWindowFullscreenInternal(DRAGGINGWINDOW, FSMODE_NONE); } const auto PWORKSPACE = DRAGGINGWINDOW->m_workspace; if (PWORKSPACE->m_hasFullscreenWindow && (!DRAGGINGWINDOW->m_isFloating || (!DRAGGINGWINDOW->m_createdOverFullscreen && !DRAGGINGWINDOW->m_pinned))) { - Debug::log(LOG, "Rejecting drag on a fullscreen workspace. (window under fullscreen)"); + Log::logger->log(Log::DEBUG, "Rejecting drag on a fullscreen workspace. (window under fullscreen)"); g_pKeybindManager->changeMouseBindMode(MBIND_INVALID); return true; } diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 2c0dac7f..1546fad5 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -649,7 +649,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) { PMONITOR = WS->m_monitor.lock(); if (!PMONITOR || !WS) { - Debug::log(ERR, "Orphaned Node {}!!", pNode); + Log::logger->log(Log::ERR, "Orphaned Node {}!!", pNode); return; } @@ -678,7 +678,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) { auto gapsIn = WORKSPACERULE.gapsIn.value_or(*PGAPSIN); if (!validMapped(PWINDOW)) { - Debug::log(ERR, "Node {} holding invalid {}!!", pNode, PWINDOW); + Log::logger->log(Log::ERR, "Node {} holding invalid {}!!", pNode, PWINDOW); return; } @@ -1092,7 +1092,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri CVarList vars(message, 0, ' '); if (vars.size() < 1 || vars[0].empty()) { - Debug::log(ERR, "layoutmsg called without params"); + Log::logger->log(Log::ERR, "layoutmsg called without params"); return 0; } -- cgit v1.2.3