| 17811 | } |
| 17812 | |
| 17813 | void ImGui::DebugLogV(const char* fmt, va_list args) |
| 17814 | { |
| 17815 | ImGuiContext& g = *GImGui; |
| 17816 | const int old_size = g.DebugLogBuf.size(); |
| 17817 | if (g.ContextName[0] != 0) |
| 17818 | g.DebugLogBuf.appendf("[%s] [%05d] ", g.ContextName, g.FrameCount); |
| 17819 | else |
| 17820 | g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); |
| 17821 | g.DebugLogBuf.appendfv(fmt, args); |
| 17822 | g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); |
| 17823 | |
| 17824 | const char* str = g.DebugLogBuf.begin() + old_size; |
| 17825 | if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY) |
| 17826 | IMGUI_DEBUG_PRINTF("%s", str); |
| 17827 | #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) |
| 17828 | if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToDebugger) |
| 17829 | { |
| 17830 | ::OutputDebugStringA("[imgui] "); |
| 17831 | ::OutputDebugStringA(str); |
| 17832 | } |
| 17833 | #endif |
| 17834 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 17835 | // IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically |
| 17836 | const int new_size = g.DebugLogBuf.size(); |
| 17837 | const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n'); |
| 17838 | if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine) |
| 17839 | IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), str); |
| 17840 | #endif |
| 17841 | } |
| 17842 | |
| 17843 | // FIXME-LAYOUT: To be done automatically via layout mode once we rework ItemSize/ItemAdd into ItemLayout. |
| 17844 | static void SameLineOrWrap(const ImVec2& size) |