| 17385 | } |
| 17386 | |
| 17387 | void ImGui::DebugLogV(const char* fmt, va_list args) |
| 17388 | { |
| 17389 | ImGuiContext& g = *GImGui; |
| 17390 | const int old_size = g.DebugLogBuf.size(); |
| 17391 | if (g.ContextName[0] != 0) |
| 17392 | g.DebugLogBuf.appendf("[%s] [%05d] ", g.ContextName, g.FrameCount); |
| 17393 | else |
| 17394 | g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); |
| 17395 | g.DebugLogBuf.appendfv(fmt, args); |
| 17396 | g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); |
| 17397 | if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY) |
| 17398 | IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size); |
| 17399 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 17400 | // IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically |
| 17401 | const int new_size = g.DebugLogBuf.size(); |
| 17402 | const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n'); |
| 17403 | if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine) |
| 17404 | IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), g.DebugLogBuf.begin() + old_size); |
| 17405 | #endif |
| 17406 | } |
| 17407 | |
| 17408 | // FIXME-LAYOUT: To be done automatically via layout mode once we rework ItemSize/ItemAdd into ItemLayout. |
| 17409 | static void SameLineOrWrap(const ImVec2& size) |