diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-12-05 20:49:10 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-12-05 20:49:10 +0800 |
| commit | f5c801de04f423269d9cefa3d725b52b87c7a0b9 (patch) | |
| tree | 51bbda6cf58cdd0a6d9128d073ad00c9337680aa /src/ui/helper/ShortcutHub.cpp | |
| parent | 5edaa008efabb1b97446bed2f6b542cf01eb3c70 (diff) | |
| download | cru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.tar.gz cru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.tar.bz2 cru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.zip | |
Refactor CRU_LOG_TAG_*.
Diffstat (limited to 'src/ui/helper/ShortcutHub.cpp')
| -rw-r--r-- | src/ui/helper/ShortcutHub.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
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<ShortcutInfo>& 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); } |
