Start logging/capturing text output to given file
| 15280 | |
| 15281 | // Start logging/capturing text output to given file |
| 15282 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 15283 | { |
| 15284 | ImGuiContext& g = *GImGui; |
| 15285 | if (g.LogEnabled) |
| 15286 | return; |
| 15287 | |
| 15288 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 15289 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 15290 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 15291 | if (!filename) |
| 15292 | filename = g.IO.LogFilename; |
| 15293 | if (!filename || !filename[0]) |
| 15294 | return; |
| 15295 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 15296 | if (!f) |
| 15297 | { |
| 15298 | IM_ASSERT(0); |
| 15299 | return; |
| 15300 | } |
| 15301 | |
| 15302 | LogBegin(ImGuiLogFlags_OutputFile, auto_open_depth); |
| 15303 | g.LogFile = f; |
| 15304 | } |
| 15305 | |
| 15306 | // Start logging/capturing text output to clipboard |
| 15307 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected