diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-07 11:46:11 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-07 11:46:11 +0800 |
commit | a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c (patch) | |
tree | b97687f99055b04775b63b7bafd2c909a7074cdb /src/ui/host/RoutedEventDispatch.h | |
parent | 20123151d12a0b01453ab6a36c84e4d3e5ea9504 (diff) | |
download | cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.gz cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.bz2 cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.zip |
Use std::string in logger.
Diffstat (limited to 'src/ui/host/RoutedEventDispatch.h')
-rw-r--r-- | src/ui/host/RoutedEventDispatch.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ui/host/RoutedEventDispatch.h b/src/ui/host/RoutedEventDispatch.h index 6677deea..4efc9208 100644 --- a/src/ui/host/RoutedEventDispatch.h +++ b/src/ui/host/RoutedEventDispatch.h @@ -26,7 +26,7 @@ void DispatchEvent( const String& event_name, controls::Control* const original_sender, events::RoutedEvent<EventArgs>* (controls::Control::*event_ptr)(), controls::Control* const last_receiver, Args&&... args) { - constexpr auto kLogTag = u"DispatchEvent"; + constexpr auto kLogTag = "DispatchEvent"; if (original_sender == nullptr) return; @@ -35,9 +35,9 @@ void DispatchEvent( if (original_sender == last_receiver) { if constexpr (debug_flags::routed_event) CRU_LOG_TAG_DEBUG( - u"Routed event {} no need to dispatch (original_sender == " + "Routed event {} no need to dispatch (original_sender == " "last_receiver). Original sender is {}.", - event_name, original_sender->GetControlType()); + event_name.ToUtf8(), original_sender->GetControlType().ToUtf8()); return; } @@ -54,16 +54,16 @@ void DispatchEvent( } if constexpr (debug_flags::routed_event) { - String log = u"Dispatch routed event "; - log += event_name; - log += u". Path (parent first): "; + std::string log = "Dispatch routed event "; + log += event_name.ToUtf8(); + log += ". Path (parent first): "; auto i = receive_list.crbegin(); const auto end = --receive_list.crend(); for (; i != end; ++i) { - log += i->Resolve()->GetControlType(); - log += u" -> "; + log += i->Resolve()->GetControlType().ToUtf8(); + log += " -> "; } - log += i->Resolve()->GetControlType(); + log += i->Resolve()->GetControlType().ToUtf8(); CRU_LOG_TAG_DEBUG(log); } @@ -83,8 +83,8 @@ void DispatchEvent( handled = true; if constexpr (debug_flags::routed_event) CRU_LOG_TAG_DEBUG( - u"Routed event is short-circuit in TUNNEL at {}-st control (count " - u"from parent).", + "Routed event is short-circuit in TUNNEL at {}-st control (count " + "from parent).", count); break; } @@ -103,8 +103,8 @@ void DispatchEvent( if (event_args.IsHandled()) { if constexpr (debug_flags::routed_event) CRU_LOG_TAG_DEBUG( - u"Routed event is short-circuit in BUBBLE at {}-st control " - u"(count from parent).", + "Routed event is short-circuit in BUBBLE at {}-st control " + "(count from parent).", count); break; } @@ -121,7 +121,7 @@ void DispatchEvent( } if constexpr (debug_flags::routed_event) - CRU_LOG_TAG_DEBUG(u"Routed event dispatch finished."); + CRU_LOG_TAG_DEBUG("Routed event dispatch finished."); WindowHost::LeaveEventHandling(); } |