Start logging/capturing text output to given file
| 10880 | |
| 10881 | // Start logging/capturing text output to given file |
| 10882 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 10883 | { |
| 10884 | ImGuiContext& g = *GImGui; |
| 10885 | if (g.LogEnabled) |
| 10886 | return; |
| 10887 | |
| 10888 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 10889 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 10890 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 10891 | if (!filename) |
| 10892 | filename = g.IO.LogFilename; |
| 10893 | if (!filename || !filename[0]) |
| 10894 | return; |
| 10895 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 10896 | if (!f) |
| 10897 | { |
| 10898 | IM_ASSERT(0); |
| 10899 | return; |
| 10900 | } |
| 10901 | |
| 10902 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 10903 | g.LogFile = f; |
| 10904 | } |
| 10905 | |
| 10906 | // Start logging/capturing text output to clipboard |
| 10907 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected