Start logging/capturing text output to given file
| 15370 | |
| 15371 | // Start logging/capturing text output to given file |
| 15372 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 15373 | { |
| 15374 | ImGuiContext& g = *GImGui; |
| 15375 | if (g.LogEnabled) |
| 15376 | return; |
| 15377 | |
| 15378 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 15379 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 15380 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 15381 | if (!filename) |
| 15382 | filename = g.IO.LogFilename; |
| 15383 | if (!filename || !filename[0]) |
| 15384 | return; |
| 15385 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 15386 | if (!f) |
| 15387 | { |
| 15388 | IM_ASSERT(0); |
| 15389 | return; |
| 15390 | } |
| 15391 | |
| 15392 | LogBegin(ImGuiLogFlags_OutputFile, auto_open_depth); |
| 15393 | g.LogFile = f; |
| 15394 | } |
| 15395 | |
| 15396 | // Start logging/capturing text output to clipboard |
| 15397 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected