Start logging/capturing text output to given file
| 13684 | |
| 13685 | // Start logging/capturing text output to given file |
| 13686 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 13687 | { |
| 13688 | ImGuiContext& g = *GImGui; |
| 13689 | if (g.LogEnabled) |
| 13690 | return; |
| 13691 | |
| 13692 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 13693 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 13694 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 13695 | if (!filename) |
| 13696 | filename = g.IO.LogFilename; |
| 13697 | if (!filename || !filename[0]) |
| 13698 | return; |
| 13699 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 13700 | if (!f) |
| 13701 | { |
| 13702 | IM_ASSERT(0); |
| 13703 | return; |
| 13704 | } |
| 13705 | |
| 13706 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 13707 | g.LogFile = f; |
| 13708 | } |
| 13709 | |
| 13710 | // Start logging/capturing text output to clipboard |
| 13711 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected