Start logging/capturing text output to given file
| 11929 | |
| 11930 | // Start logging/capturing text output to given file |
| 11931 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 11932 | { |
| 11933 | ImGuiContext& g = *GImGui; |
| 11934 | if (g.LogEnabled) |
| 11935 | return; |
| 11936 | |
| 11937 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 11938 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 11939 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 11940 | if (!filename) |
| 11941 | filename = g.IO.LogFilename; |
| 11942 | if (!filename || !filename[0]) |
| 11943 | return; |
| 11944 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 11945 | if (!f) |
| 11946 | { |
| 11947 | IM_ASSERT(0); |
| 11948 | return; |
| 11949 | } |
| 11950 | |
| 11951 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 11952 | g.LogFile = f; |
| 11953 | } |
| 11954 | |
| 11955 | // Start logging/capturing text output to clipboard |
| 11956 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected