From c6b80c56644a35faad6aa7452102fa289f53ece4 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 7 Jul 2024 18:01:47 -0700 Subject: [PATCH] add entity to error message (#14163) # Objective - There was a new warning added about having an unstyled child in the ui hierarchy. Debugging the new error is pretty hard without any info about which entity is. ## Solution - Add the entity id to the warning. ```text // Before 2024-07-05T19:40:59.904014Z WARN bevy_ui::layout::ui_surface: Unstyled child in a UI entity hierarchy. You are using an entity without UI components as a child of an entity with UI components, results may be unexpected. //After 2024-07-05T19:40:59.904014Z WARN bevy_ui::layout::ui_surface: Unstyled child `3v1` in a UI entity hierarchy. You are using an entity without UI components as a child of an entity with UI components, results may be unexpected. ``` ## Changelog - add entity id to ui surface warning --- crates/bevy_ui/src/layout/ui_surface.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/layout/ui_surface.rs b/crates/bevy_ui/src/layout/ui_surface.rs index 8bb13d83bc..378cb7b78a 100644 --- a/crates/bevy_ui/src/layout/ui_surface.rs +++ b/crates/bevy_ui/src/layout/ui_surface.rs @@ -119,7 +119,7 @@ impl UiSurface { taffy_children.push(*taffy_node); } else { warn!( - "Unstyled child in a UI entity hierarchy. You are using an entity \ + "Unstyled child `{child}` in a UI entity hierarchy. You are using an entity \ without UI components as a child of an entity with UI components, results may be unexpected." ); }