Start logging/capturing text output to given file
| 12756 | |
| 12757 | // Start logging/capturing text output to given file |
| 12758 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 12759 | { |
| 12760 | ImGuiContext& g = *GImGui; |
| 12761 | if (g.LogEnabled) |
| 12762 | return; |
| 12763 | |
| 12764 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 12765 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 12766 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 12767 | if (!filename) |
| 12768 | filename = g.IO.LogFilename; |
| 12769 | if (!filename || !filename[0]) |
| 12770 | return; |
| 12771 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 12772 | if (!f) |
| 12773 | { |
| 12774 | IM_ASSERT(0); |
| 12775 | return; |
| 12776 | } |
| 12777 | |
| 12778 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 12779 | g.LogFile = f; |
| 12780 | } |
| 12781 | |
| 12782 | // Start logging/capturing text output to clipboard |
| 12783 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected