| 12960 | } |
| 12961 | |
| 12962 | void ImGui::LogFinish() |
| 12963 | { |
| 12964 | ImGuiContext& g = *GImGui; |
| 12965 | if (!g.LogEnabled) |
| 12966 | return; |
| 12967 | |
| 12968 | LogText(IM_NEWLINE); |
| 12969 | switch (g.LogType) |
| 12970 | { |
| 12971 | case ImGuiLogType_TTY: |
| 12972 | #ifndef IMGUI_DISABLE_TTY_FUNCTIONS |
| 12973 | fflush(g.LogFile); |
| 12974 | #endif |
| 12975 | break; |
| 12976 | case ImGuiLogType_File: |
| 12977 | ImFileClose(g.LogFile); |
| 12978 | break; |
| 12979 | case ImGuiLogType_Buffer: |
| 12980 | break; |
| 12981 | case ImGuiLogType_Clipboard: |
| 12982 | if (!g.LogBuffer.empty()) |
| 12983 | SetClipboardText(g.LogBuffer.begin()); |
| 12984 | break; |
| 12985 | case ImGuiLogType_None: |
| 12986 | IM_ASSERT(0); |
| 12987 | break; |
| 12988 | } |
| 12989 | |
| 12990 | g.LogEnabled = false; |
| 12991 | g.LogType = ImGuiLogType_None; |
| 12992 | g.LogFile = NULL; |
| 12993 | g.LogBuffer.clear(); |
| 12994 | } |
| 12995 | |
| 12996 | // Helper to display logging buttons |
| 12997 | // FIXME-OBSOLETE: We should probably obsolete this and let the user have their own helper (this is one of the oldest function alive!) |
nothing calls this directly
no test coverage detected