Start logging/capturing text output to given file
| 12919 | |
| 12920 | // Start logging/capturing text output to given file |
| 12921 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 12922 | { |
| 12923 | ImGuiContext& g = *GImGui; |
| 12924 | if (g.LogEnabled) |
| 12925 | return; |
| 12926 | |
| 12927 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 12928 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 12929 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 12930 | if (!filename) |
| 12931 | filename = g.IO.LogFilename; |
| 12932 | if (!filename || !filename[0]) |
| 12933 | return; |
| 12934 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 12935 | if (!f) |
| 12936 | { |
| 12937 | IM_ASSERT(0); |
| 12938 | return; |
| 12939 | } |
| 12940 | |
| 12941 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 12942 | g.LogFile = f; |
| 12943 | } |
| 12944 | |
| 12945 | // Start logging/capturing text output to clipboard |
| 12946 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected