aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-08-18 18:38:10 +0800
committerYuqian Yang <crupest@crupest.life>2025-08-18 18:38:10 +0800
commitb53780b2106b0f233c48e27653336b8a629ca486 (patch)
treee5e2659eb23852012804e9ba8a290a8e19d8230f /src
parentd3568fb844c7b9ea59783b04899dbd94ad972b91 (diff)
downloadcru-b53780b2106b0f233c48e27653336b8a629ca486.tar.gz
cru-b53780b2106b0f233c48e27653336b8a629ca486.tar.bz2
cru-b53780b2106b0f233c48e27653336b8a629ca486.zip
Rename CRU_LOG_* to CRU_LOG_TAG_*.
Diffstat (limited to 'src')
-rw-r--r--src/base/platform/unix/PosixSpawnSubProcess.cpp2
-rw-r--r--src/base/platform/unix/UnixPipe.cpp2
-rw-r--r--src/platform/graphics/direct2d/Painter.cpp2
-rw-r--r--src/platform/gui/osx/Clipboard.mm2
-rw-r--r--src/platform/gui/osx/Window.mm6
-rw-r--r--src/platform/gui/win/Clipboard.cpp16
-rw-r--r--src/platform/gui/win/Cursor.cpp2
-rw-r--r--src/platform/gui/win/GodWindow.cpp2
-rw-r--r--src/platform/gui/win/InputMethod.cpp20
-rw-r--r--src/platform/gui/win/Window.cpp10
-rw-r--r--src/ui/ThemeResourceDictionary.cpp4
-rw-r--r--src/ui/controls/Control.cpp2
-rw-r--r--src/ui/controls/TextHostControlService.cpp12
-rw-r--r--src/ui/helper/ClickDetector.cpp4
-rw-r--r--src/ui/helper/ShortcutHub.cpp16
-rw-r--r--src/ui/host/RoutedEventDispatch.h10
-rw-r--r--src/ui/host/WindowHost.cpp2
-rw-r--r--src/ui/render/BorderRenderObject.cpp4
-rw-r--r--src/ui/render/FlexLayoutRenderObject.cpp2
-rw-r--r--src/ui/render/RenderObject.cpp10
-rw-r--r--src/ui/render/TextRenderObject.cpp2
21 files changed, 66 insertions, 66 deletions
diff --git a/src/base/platform/unix/PosixSpawnSubProcess.cpp b/src/base/platform/unix/PosixSpawnSubProcess.cpp
index 5e09c494..631c14b8 100644
--- a/src/base/platform/unix/PosixSpawnSubProcess.cpp
+++ b/src/base/platform/unix/PosixSpawnSubProcess.cpp
@@ -162,7 +162,7 @@ SubProcessExitResult PosixSpawnSubProcessImpl::PlatformWaitForProcess() {
while (waitpid(pid_, &wstatus, 0) == -1) {
if (errno == EINTR) {
- CRU_LOG_INFO(u"Waitpid is interrupted by a signal. Call it again.");
+ CRU_LOG_TAG_INFO(u"Waitpid is interrupted by a signal. Call it again.");
continue;
}
diff --git a/src/base/platform/unix/UnixPipe.cpp b/src/base/platform/unix/UnixPipe.cpp
index 747efe94..f512c2f4 100644
--- a/src/base/platform/unix/UnixPipe.cpp
+++ b/src/base/platform/unix/UnixPipe.cpp
@@ -43,7 +43,7 @@ UnixPipe::~UnixPipe() {
if (auto_close_) {
auto self_fd = GetSelfFileDescriptor();
if (::close(self_fd) != 0) {
- CRU_LOG_ERROR(u"Failed to close unix pipe file descriptor {}, errno {}.",
+ CRU_LOG_TAG_ERROR(u"Failed to close unix pipe file descriptor {}, errno {}.",
self_fd, errno);
}
}
diff --git a/src/platform/graphics/direct2d/Painter.cpp b/src/platform/graphics/direct2d/Painter.cpp
index 95b0bb4e..ec96080a 100644
--- a/src/platform/graphics/direct2d/Painter.cpp
+++ b/src/platform/graphics/direct2d/Painter.cpp
@@ -22,7 +22,7 @@ D2DDeviceContextPainter::D2DDeviceContextPainter(
D2DDeviceContextPainter::~D2DDeviceContextPainter() {
if (is_drawing_) {
- CRU_LOG_INFO(u"You may forget to call EndDraw before destroying painter.");
+ CRU_LOG_TAG_INFO(u"You may forget to call EndDraw before destroying painter.");
}
if (release_) {
diff --git a/src/platform/gui/osx/Clipboard.mm b/src/platform/gui/osx/Clipboard.mm
index f15232e2..db5f6ed3 100644
--- a/src/platform/gui/osx/Clipboard.mm
+++ b/src/platform/gui/osx/Clipboard.mm
@@ -25,7 +25,7 @@ OsxClipboardPrivate::~OsxClipboardPrivate() {}
String OsxClipboardPrivate::GetText() {
auto result = [pasteboard_ readObjectsForClasses:@[ NSString.class ] options:nil];
if (result == nil) {
- CRU_LOG_WARN(u"Failed to get text from clipboard");
+ CRU_LOG_TAG_WARN(u"Failed to get text from clipboard");
return u"";
} else {
if (result.count == 0) {
diff --git a/src/platform/gui/osx/Window.mm b/src/platform/gui/osx/Window.mm
index f3a95fad..6559cf70 100644
--- a/src/platform/gui/osx/Window.mm
+++ b/src/platform/gui/osx/Window.mm
@@ -634,7 +634,7 @@ const std::unordered_set<KeyCode> input_context_handle_codes_when_has_text{
}
- (void)keyUp:(NSEvent*)event {
- // cru::CRU_LOG_DEBUG(u"CruView", u"Recieved key up.");
+ // cru::CRU_LOG_TAG_DEBUG(u"CruView", u"Recieved key up.");
auto key_modifier = GetKeyModifier(event);
auto c = cru::platform::gui::osx::KeyCodeFromOsxToCru(event.keyCode);
@@ -669,7 +669,7 @@ const std::unordered_set<KeyCode> input_context_handle_codes_when_has_text{
auto ss = FromCFStringRef(s);
- // cru::CRU_LOG_DEBUG(u"CruView",
+ // cru::CRU_LOG_TAG_DEBUG(u"CruView",
// u"Received setMarkedText string: {}, selected range: ({}, {}), "
// u"replacement range: ({}, {}).",
// ss, selectedRange.location, selectedRange.length, replacementRange.location,
@@ -730,7 +730,7 @@ const std::unordered_set<KeyCode> input_context_handle_codes_when_has_text{
_input_context_p->SetCompositionText(cru::platform::gui::CompositionText());
auto ss = FromCFStringRef(s);
- // cru::CRU_LOG_DEBUG(u"CruView", u"Finish composition: {}, replacement range: ({}, {})", ss,
+ // cru::CRU_LOG_TAG_DEBUG(u"CruView", u"Finish composition: {}, replacement range: ({}, {})", ss,
// replacementRange.location, replacementRange.length);
_input_context_p->RaiseTextEvent(ss);
diff --git a/src/platform/gui/win/Clipboard.cpp b/src/platform/gui/win/Clipboard.cpp
index a0914a0b..9e305d1c 100644
--- a/src/platform/gui/win/Clipboard.cpp
+++ b/src/platform/gui/win/Clipboard.cpp
@@ -13,25 +13,25 @@ String WinClipboard::GetText() {
auto god_window = application_->GetGodWindow();
if (!::OpenClipboard(god_window->GetHandle())) {
- CRU_LOG_WARN(u"Failed to open clipboard.");
+ CRU_LOG_TAG_WARN(u"Failed to open clipboard.");
return {};
}
if (!::IsClipboardFormatAvailable(CF_UNICODETEXT)) {
- CRU_LOG_WARN(u"Clipboard format for text is not available.");
+ CRU_LOG_TAG_WARN(u"Clipboard format for text is not available.");
return {};
}
auto handle = ::GetClipboardData(CF_UNICODETEXT);
if (handle == nullptr) {
- CRU_LOG_WARN(u"Failed to get clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to get clipboard data.");
return {};
}
auto ptr = ::GlobalLock(handle);
if (ptr == nullptr) {
- CRU_LOG_WARN(u"Failed to lock clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to lock clipboard data.");
::CloseClipboard();
return {};
}
@@ -48,21 +48,21 @@ void WinClipboard::SetText(String text) {
auto god_window = application_->GetGodWindow();
if (!::OpenClipboard(god_window->GetHandle())) {
- CRU_LOG_WARN(u"Failed to open clipboard.");
+ CRU_LOG_TAG_WARN(u"Failed to open clipboard.");
return;
}
auto handle = GlobalAlloc(GMEM_MOVEABLE, (text.size() + 1) * sizeof(wchar_t));
if (handle == nullptr) {
- CRU_LOG_WARN(u"Failed to allocate clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to allocate clipboard data.");
::CloseClipboard();
return;
}
auto ptr = ::GlobalLock(handle);
if (ptr == nullptr) {
- CRU_LOG_WARN(u"Failed to lock clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to lock clipboard data.");
::GlobalFree(handle);
::CloseClipboard();
return;
@@ -73,7 +73,7 @@ void WinClipboard::SetText(String text) {
::GlobalUnlock(handle);
if (::SetClipboardData(CF_UNICODETEXT, handle) == nullptr) {
- CRU_LOG_WARN(u"Failed to set clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to set clipboard data.");
}
::CloseClipboard();
diff --git a/src/platform/gui/win/Cursor.cpp b/src/platform/gui/win/Cursor.cpp
index d7692c2d..e6cce5b9 100644
--- a/src/platform/gui/win/Cursor.cpp
+++ b/src/platform/gui/win/Cursor.cpp
@@ -16,7 +16,7 @@ WinCursor::~WinCursor() {
if (!::DestroyCursor(handle_)) {
// This is not a fetal error but might still need notice because it may
// cause leak.
- CRU_LOG_WARN(u"Failed to destroy a cursor. Last error code: {}",
+ CRU_LOG_TAG_WARN(u"Failed to destroy a cursor. Last error code: {}",
::GetLastError());
}
}
diff --git a/src/platform/gui/win/GodWindow.cpp b/src/platform/gui/win/GodWindow.cpp
index 364688e5..c969df8f 100644
--- a/src/platform/gui/win/GodWindow.cpp
+++ b/src/platform/gui/win/GodWindow.cpp
@@ -43,7 +43,7 @@ GodWindow::GodWindow(WinUiApplication* application) {
GodWindow::~GodWindow() {
if (!::DestroyWindow(hwnd_)) {
// Although this could be "safely" ignore.
- CRU_LOG_WARN(u"Failed to destroy god window.");
+ CRU_LOG_TAG_WARN(u"Failed to destroy god window.");
}
}
diff --git a/src/platform/gui/win/InputMethod.cpp b/src/platform/gui/win/InputMethod.cpp
index 44b5681d..306dc3fa 100644
--- a/src/platform/gui/win/InputMethod.cpp
+++ b/src/platform/gui/win/InputMethod.cpp
@@ -35,7 +35,7 @@ AutoHIMC& AutoHIMC::operator=(AutoHIMC&& other) {
AutoHIMC::~AutoHIMC() {
if (handle_) {
if (!::ImmReleaseContext(hwnd_, handle_))
- CRU_LOG_WARN(u"Failed to release HIMC.");
+ CRU_LOG_TAG_WARN(u"Failed to release HIMC.");
}
}
@@ -156,7 +156,7 @@ WinInputMethodContext::~WinInputMethodContext() {}
void WinInputMethodContext::EnableIME() {
const auto hwnd = native_window_->GetWindowHandle();
if (::ImmAssociateContextEx(hwnd, nullptr, IACE_DEFAULT) == FALSE) {
- CRU_LOG_WARN(u"Failed to enable ime.");
+ CRU_LOG_TAG_WARN(u"Failed to enable ime.");
}
}
@@ -167,21 +167,21 @@ void WinInputMethodContext::DisableIME() {
::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
if (::ImmAssociateContextEx(hwnd, nullptr, 0) == FALSE) {
- CRU_LOG_WARN(u"Failed to disable ime.");
+ CRU_LOG_TAG_WARN(u"Failed to disable ime.");
}
}
void WinInputMethodContext::CompleteComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0)) {
- CRU_LOG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN(u"Failed to complete composition.");
}
}
void WinInputMethodContext::CancelComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_CANCEL, 0)) {
- CRU_LOG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN(u"Failed to complete composition.");
}
}
@@ -200,7 +200,7 @@ void WinInputMethodContext::SetCandidateWindowPosition(const Point& point) {
form.ptCurrentPos = native_window_->DipToPixel(point);
if (!::ImmSetCandidateWindow(himc.Get(), &form))
- CRU_LOG_DEBUG(u"Failed to set input method candidate window position.");
+ CRU_LOG_TAG_DEBUG(u"Failed to set input method candidate window position.");
}
IEvent<std::nullptr_t>* WinInputMethodContext::CompositionStartEvent() {
@@ -227,7 +227,7 @@ void WinInputMethodContext::OnWindowNativeMessage(
// I don't think this will happen because normal key strike without ime
// should only trigger ascci character. If it is a charater from
// supplementary planes, it should be handled with ime messages.
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"A WM_CHAR message for character from supplementary "
u"planes is ignored.");
} else {
@@ -245,7 +245,7 @@ void WinInputMethodContext::OnWindowNativeMessage(
composition_event_.Raise(nullptr);
auto composition_text = GetCompositionText();
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}",
+ CRU_LOG_TAG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}",
composition_text);
}
if (message.l_param & GCS_RESULTSTR) {
@@ -256,14 +256,14 @@ void WinInputMethodContext::OnWindowNativeMessage(
}
case WM_IME_STARTCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_STARTCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG(u"WM_IME_STARTCOMPOSITION received.");
}
composition_start_event_.Raise(nullptr);
break;
}
case WM_IME_ENDCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_ENDCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG(u"WM_IME_ENDCOMPOSITION received.");
}
composition_end_event_.Raise(nullptr);
break;
diff --git a/src/platform/gui/win/Window.cpp b/src/platform/gui/win/Window.cpp
index 47ca93f8..690e56de 100644
--- a/src/platform/gui/win/Window.cpp
+++ b/src/platform/gui/win/Window.cpp
@@ -207,7 +207,7 @@ bool WinNativeWindow::ReleaseMouse() {
void WinNativeWindow::RequestRepaint() {
if constexpr (DebugFlags::paint) {
- CRU_LOG_DEBUG(u"A repaint is requested.");
+ CRU_LOG_TAG_DEBUG(u"A repaint is requested.");
}
if (!::InvalidateRect(hwnd_, nullptr, FALSE))
throw Win32Error(::GetLastError(), u"Failed to invalidate window.");
@@ -234,7 +234,7 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) {
if (!::SetClassLongPtrW(hwnd_, GCLP_HCURSOR,
reinterpret_cast<LONG_PTR>(cursor_->GetHandle()))) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"Failed to set cursor because failed to set class long. Last "
u"error code: {}.",
::GetLastError());
@@ -244,7 +244,7 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) {
if (GetVisibility() != WindowVisibilityType::Show) return;
auto lg = [](StringView reason) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"Failed to set cursor because {} when window is visible. (We need to "
u"update cursor if it is inside the window.) Last error code: {}.",
@@ -477,7 +477,7 @@ void WinNativeWindow::RecreateWindow() {
if (dpi == 0)
throw Win32Error(::GetLastError(), u"Failed to get dpi of window.");
dpi_ = static_cast<float>(dpi);
- CRU_LOG_DEBUG(u"Dpi of window is {}.", dpi_);
+ CRU_LOG_TAG_DEBUG(u"Dpi of window is {}.", dpi_);
window_manager->RegisterWindow(hwnd_, this);
@@ -507,7 +507,7 @@ void WinNativeWindow::OnPaintInternal() {
paint_event_.Raise(nullptr);
ValidateRect(hwnd_, nullptr);
if constexpr (DebugFlags::paint) {
- CRU_LOG_DEBUG(u"A repaint is finished.");
+ CRU_LOG_TAG_DEBUG(u"A repaint is finished.");
}
}
diff --git a/src/ui/ThemeResourceDictionary.cpp b/src/ui/ThemeResourceDictionary.cpp
index c5986962..fff25e09 100644
--- a/src/ui/ThemeResourceDictionary.cpp
+++ b/src/ui/ThemeResourceDictionary.cpp
@@ -47,10 +47,10 @@ void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) {
resource_map_[entry.name] = std::move(entry);
} else {
- CRU_LOG_DEBUG(u"Ignore unknown element {} of theme.", c->GetTag());
+ CRU_LOG_TAG_DEBUG(u"Ignore unknown element {} of theme.", c->GetTag());
}
} else {
- CRU_LOG_DEBUG(u"Ignore text or comment node of theme.");
+ CRU_LOG_TAG_DEBUG(u"Ignore text or comment node of theme.");
}
}
}
diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp
index 17633e3d..d6770684 100644
--- a/src/ui/controls/Control.cpp
+++ b/src/ui/controls/Control.cpp
@@ -30,7 +30,7 @@ Control::Control() {
Control::~Control() {
if (host::WindowHost::IsInEventHandling()) {
- CRU_LOG_ERROR(
+ CRU_LOG_TAG_ERROR(
u"Control destroyed during event handling. Please use DeleteLater.");
}
diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp
index 3e885bd3..bc562e88 100644
--- a/src/ui/controls/TextHostControlService.cpp
+++ b/src/ui/controls/TextHostControlService.cpp
@@ -227,7 +227,7 @@ void TextHostControlService::SetText(String text, bool stop_composition) {
void TextHostControlService::InsertText(Index position, StringView text,
bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text insert position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text insert position.");
return;
}
this->text_.insert(this->text_.cbegin() + position, text);
@@ -240,7 +240,7 @@ void TextHostControlService::InsertText(Index position, StringView text,
void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text delete position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete position.");
return;
}
if (position == static_cast<Index>(this->text_.size())) return;
@@ -253,7 +253,7 @@ void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
Index TextHostControlService::DeleteCharPrevious(Index position,
bool stop_composition) {
if (!Utf16IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_ERROR(u"Invalid text delete position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete position.");
return 0;
}
if (position == 0) return 0;
@@ -269,11 +269,11 @@ void TextHostControlService::DeleteText(TextRange range,
if (range.count == 0) return;
range = range.Normalize();
if (!Utf16IsValidInsertPosition(this->text_, range.GetStart())) {
- CRU_LOG_ERROR(u"Invalid text delete start position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete start position.");
return;
}
if (!Utf16IsValidInsertPosition(this->text_, range.GetStart())) {
- CRU_LOG_ERROR(u"Invalid text delete end position.");
+ CRU_LOG_TAG_ERROR(u"Invalid text delete end position.");
return;
}
this->text_.erase(this->text_.cbegin() + range.GetStart(),
@@ -465,7 +465,7 @@ void TextHostControlService::UpdateInputMethodPosition() {
right_bottom.y += 5;
if constexpr (debug_flags::text_service) {
- CRU_LOG_DEBUG(u"Calculate input method candidate window position: {}.",
+ CRU_LOG_TAG_DEBUG(u"Calculate input method candidate window position: {}.",
right_bottom);
}
diff --git a/src/ui/helper/ClickDetector.cpp b/src/ui/helper/ClickDetector.cpp
index de39f14e..b7e800a8 100644
--- a/src/ui/helper/ClickDetector.cpp
+++ b/src/ui/helper/ClickDetector.cpp
@@ -58,7 +58,7 @@ ClickDetector::ClickDetector(controls::Control* control) {
this->state_ == ClickState::Hover) {
if (!this->control_->CaptureMouse()) {
if constexpr (debug_flags::click_detector) {
- CRU_LOG_DEBUG(u"Failed to capture mouse when begin click.");
+ CRU_LOG_TAG_DEBUG(u"Failed to capture mouse when begin click.");
}
return;
}
@@ -137,7 +137,7 @@ void ClickDetector::SetState(ClickState state) {
UnreachableCode();
}
};
- CRU_LOG_DEBUG(u"Click state changed, new state: {}.", to_string(state));
+ CRU_LOG_TAG_DEBUG(u"Click state changed, new state: {}.", to_string(state));
}
state_ = state;
diff --git a/src/ui/helper/ShortcutHub.cpp b/src/ui/helper/ShortcutHub.cpp
index 30a563ed..c413ab2a 100644
--- a/src/ui/helper/ShortcutHub.cpp
+++ b/src/ui/helper/ShortcutHub.cpp
@@ -64,7 +64,7 @@ const std::vector<ShortcutInfo>& ShortcutHub::GetShortcutByKeyBind(
void ShortcutHub::Install(controls::Control* control) {
if (!event_guard_.IsEmpty()) {
- CRU_LOG_ERROR(u"Shortcut hub is already installed. Failed to install.");
+ CRU_LOG_TAG_ERROR(u"Shortcut hub is already installed. Failed to install.");
return;
}
@@ -74,7 +74,7 @@ void ShortcutHub::Install(controls::Control* control) {
void ShortcutHub::Uninstall() {
if (event_guard_.IsEmpty()) {
- CRU_LOG_WARN(u"Shortcut hub is not installed. Failed to uninstall.");
+ CRU_LOG_TAG_WARN(u"Shortcut hub is not installed. Failed to uninstall.");
return;
}
@@ -89,9 +89,9 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
if constexpr (debug_flags::shortcut) {
if (shortcut_list.empty()) {
- CRU_LOG_DEBUG(u"No shortcut for key bind {}.", key_bind.ToString());
+ CRU_LOG_TAG_DEBUG(u"No shortcut for key bind {}.", key_bind.ToString());
}
- CRU_LOG_DEBUG(u"Begin to handle shortcut for key bind {}.",
+ CRU_LOG_TAG_DEBUG(u"Begin to handle shortcut for key bind {}.",
key_bind.ToString());
}
@@ -99,7 +99,7 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
auto is_handled = shortcut.handler();
if (is_handled) {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(u"Handle {} handled it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG(u"Handle {} handled it.", shortcut.name);
}
handled = true;
@@ -108,21 +108,21 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
break;
} else {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(u"Handle {} didn't handle it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG(u"Handle {} didn't handle it.", shortcut.name);
}
}
}
if constexpr (debug_flags::shortcut) {
if (!shortcut_list.empty()) {
- CRU_LOG_DEBUG(u"End handling shortcut for key bind {}.",
+ CRU_LOG_TAG_DEBUG(u"End handling shortcut for key bind {}.",
key_bind.ToString());
}
}
if (!handled) {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Raise fallback event for unhandled shortcut of key bind {}.",
key_bind.ToString());
}
diff --git a/src/ui/host/RoutedEventDispatch.h b/src/ui/host/RoutedEventDispatch.h
index 207e1ee6..6677deea 100644
--- a/src/ui/host/RoutedEventDispatch.h
+++ b/src/ui/host/RoutedEventDispatch.h
@@ -34,7 +34,7 @@ void DispatchEvent(
if (original_sender == last_receiver) {
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event {} no need to dispatch (original_sender == "
"last_receiver). Original sender is {}.",
event_name, original_sender->GetControlType());
@@ -64,7 +64,7 @@ void DispatchEvent(
log += u" -> ";
}
log += i->Resolve()->GetControlType();
- CRU_LOG_DEBUG(log);
+ CRU_LOG_TAG_DEBUG(log);
}
auto handled = false;
@@ -82,7 +82,7 @@ void DispatchEvent(
if (event_args.IsHandled()) {
handled = true;
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event is short-circuit in TUNNEL at {}-st control (count "
u"from parent).",
count);
@@ -102,7 +102,7 @@ void DispatchEvent(
->Raise(event_args);
if (event_args.IsHandled()) {
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Routed event is short-circuit in BUBBLE at {}-st control "
u"(count from parent).",
count);
@@ -121,7 +121,7 @@ void DispatchEvent(
}
if constexpr (debug_flags::routed_event)
- CRU_LOG_DEBUG(u"Routed event dispatch finished.");
+ CRU_LOG_TAG_DEBUG(u"Routed event dispatch finished.");
WindowHost::LeaveEventHandling();
}
diff --git a/src/ui/host/WindowHost.cpp b/src/ui/host/WindowHost.cpp
index 616803b6..9d0e2006 100644
--- a/src/ui/host/WindowHost.cpp
+++ b/src/ui/host/WindowHost.cpp
@@ -202,7 +202,7 @@ void WindowHost::RelayoutWithSize(const Size& available_size,
for (auto& action : after_layout_stable_action_) action();
after_layout_event_.Raise(AfterLayoutEventArgs{});
after_layout_stable_action_.clear();
- if constexpr (debug_flags::layout) CRU_LOG_DEBUG(u"A relayout is finished.");
+ if constexpr (debug_flags::layout) CRU_LOG_TAG_DEBUG(u"A relayout is finished.");
}
void WindowHost::Repaint() {
diff --git a/src/ui/render/BorderRenderObject.cpp b/src/ui/render/BorderRenderObject.cpp
index 81a1aa60..0e97c5e8 100644
--- a/src/ui/render/BorderRenderObject.cpp
+++ b/src/ui/render/BorderRenderObject.cpp
@@ -81,7 +81,7 @@ RenderObject* BorderRenderObject::HitTest(const Point& point) {
void BorderRenderObject::Draw(platform::graphics::IPainter* painter) {
if constexpr (debug_flags::draw) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"BorderRenderObject draw, background: {}, foreground: {}.",
background_brush_ == nullptr ? u"NONE"
: background_brush_->GetDebugString(),
@@ -95,7 +95,7 @@ void BorderRenderObject::Draw(platform::graphics::IPainter* painter) {
if (is_border_enabled_) {
if (border_brush_ == nullptr) {
- CRU_LOG_WARN(u"Border is enabled but border brush is null.");
+ CRU_LOG_TAG_WARN(u"Border is enabled but border brush is null.");
} else {
painter->FillGeometry(geometry_.get(), border_brush_.get());
}
diff --git a/src/ui/render/FlexLayoutRenderObject.cpp b/src/ui/render/FlexLayoutRenderObject.cpp
index 7bbf9d57..588c379b 100644
--- a/src/ui/render/FlexLayoutRenderObject.cpp
+++ b/src/ui/render/FlexLayoutRenderObject.cpp
@@ -300,7 +300,7 @@ Size FlexLayoutMeasureContentImpl(
if (max_main_length.IsSpecified() &&
total_length > max_main_length.GetLengthOrUndefined()) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"(Measure) Children's main axis length exceeds required max length.");
total_length = max_main_length.GetLengthOrUndefined();
} else if (min_main_length.IsSpecified() &&
diff --git a/src/ui/render/RenderObject.cpp b/src/ui/render/RenderObject.cpp
index 64411036..b3a28d6d 100644
--- a/src/ui/render/RenderObject.cpp
+++ b/src/ui/render/RenderObject.cpp
@@ -119,7 +119,7 @@ void RenderObject::Measure(const MeasureRequirement& requirement,
preferred_size.OverrideBy(preferred_size_);
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Measure begins :\nrequirement: {}\npreferred size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Measure begins :\nrequirement: {}\npreferred size: {}",
this->GetDebugPathInTree(), requirement.ToDebugString(),
preferred_size.ToDebugString());
}
@@ -127,7 +127,7 @@ void RenderObject::Measure(const MeasureRequirement& requirement,
desired_size_ = OnMeasureCore(merged_requirement, merged_preferred_size);
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Measure ends :\nresult size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Measure ends :\nresult size: {}",
this->GetDebugPathInTree(), desired_size_);
}
@@ -144,7 +144,7 @@ Size RenderObject::Measure1(const BoxConstraint& constraint) {
void RenderObject::Layout(const Point& offset) {
if constexpr (cru::ui::debug_flags::layout) {
- CRU_LOG_DEBUG(u"{} Layout :\noffset: {} size: {}",
+ CRU_LOG_TAG_DEBUG(u"{} Layout :\noffset: {} size: {}",
this->GetDebugPathInTree(), offset, desired_size_);
}
offset_ = offset;
@@ -192,13 +192,13 @@ Size RenderObject::OnMeasureCore1(const BoxConstraint& constraint) {
if (space_size.width > merged_constraint.max.width) {
space_size.width = merged_constraint.max.width;
- CRU_LOG_WARN(u"{} space width is over constraint.max.width",
+ CRU_LOG_TAG_WARN(u"{} space width is over constraint.max.width",
this->GetDebugPathInTree());
}
if (space_size.height > merged_constraint.max.height) {
space_size.height = merged_constraint.max.height;
- CRU_LOG_WARN(u"{} space height is over constraint.max.height",
+ CRU_LOG_TAG_WARN(u"{} space height is over constraint.max.height",
this->GetDebugPathInTree());
}
diff --git a/src/ui/render/TextRenderObject.cpp b/src/ui/render/TextRenderObject.cpp
index 14e45080..8a579041 100644
--- a/src/ui/render/TextRenderObject.cpp
+++ b/src/ui/render/TextRenderObject.cpp
@@ -177,7 +177,7 @@ RenderObject* TextRenderObject::HitTest(const Point& point) {
void TextRenderObject::Draw(platform::graphics::IPainter* painter) {
if constexpr (debug_flags::draw) {
- CRU_LOG_DEBUG(
+ CRU_LOG_TAG_DEBUG(
u"Begin to paint, total_offset: {}, size: {}, text_layout: "
u"{}, brush: {}.",
this->GetTotalOffset(), this->GetDesiredSize(),