From f5c801de04f423269d9cefa3d725b52b87c7a0b9 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 5 Dec 2025 20:49:10 +0800 Subject: Refactor CRU_LOG_TAG_*. --- src/ui/helper/ShortcutHub.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/ui/helper/ShortcutHub.cpp') diff --git a/src/ui/helper/ShortcutHub.cpp b/src/ui/helper/ShortcutHub.cpp index fd23802e..13cce216 100644 --- a/src/ui/helper/ShortcutHub.cpp +++ b/src/ui/helper/ShortcutHub.cpp @@ -64,7 +64,8 @@ const std::vector& ShortcutHub::GetShortcutByKeyBind( void ShortcutHub::Install(controls::Control* control) { if (!event_guard_.IsEmpty()) { - CRU_LOG_TAG_ERROR("Shortcut hub is already installed. Failed to install."); + CruLogError(kLogTag, + "Shortcut hub is already installed. Failed to install."); return; } @@ -74,7 +75,7 @@ void ShortcutHub::Install(controls::Control* control) { void ShortcutHub::Uninstall() { if (event_guard_.IsEmpty()) { - CRU_LOG_TAG_WARN("Shortcut hub is not installed. Failed to uninstall."); + CruLogWarn(kLogTag, "Shortcut hub is not installed. Failed to uninstall."); return; } @@ -89,17 +90,17 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) { if constexpr (debug_flags::shortcut) { if (shortcut_list.empty()) { - CRU_LOG_TAG_DEBUG("No shortcut for key bind {}.", key_bind.ToString()); + CruLogDebug(kLogTag, "No shortcut for key bind {}.", key_bind.ToString()); } - CRU_LOG_TAG_DEBUG("Begin to handle shortcut for key bind {}.", - key_bind.ToString()); + CruLogDebug(kLogTag, "Begin to handle shortcut for key bind {}.", + key_bind.ToString()); } for (const auto& shortcut : shortcut_list) { auto is_handled = shortcut.handler(); if (is_handled) { if constexpr (debug_flags::shortcut) { - CRU_LOG_TAG_DEBUG("Handle {} handled it.", shortcut.name); + CruLogDebug(kLogTag, "Handle {} handled it.", shortcut.name); } handled = true; @@ -108,23 +109,23 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) { break; } else { if constexpr (debug_flags::shortcut) { - CRU_LOG_TAG_DEBUG("Handle {} didn't handle it.", shortcut.name); + CruLogDebug(kLogTag, "Handle {} didn't handle it.", shortcut.name); } } } if constexpr (debug_flags::shortcut) { if (!shortcut_list.empty()) { - CRU_LOG_TAG_DEBUG("End handling shortcut for key bind {}.", - key_bind.ToString()); + CruLogDebug(kLogTag, "End handling shortcut for key bind {}.", + key_bind.ToString()); } } if (!handled) { if constexpr (debug_flags::shortcut) { - CRU_LOG_TAG_DEBUG( - "Raise fallback event for unhandled shortcut of key bind {}.", - key_bind.ToString()); + CruLogDebug(kLogTag, + "Raise fallback event for unhandled shortcut of key bind {}.", + key_bind.ToString()); } fallback_event_.Raise(event); } -- cgit v1.2.3