Start logging/capturing text output to given file
| 14974 | |
| 14975 | // Start logging/capturing text output to given file |
| 14976 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 14977 | { |
| 14978 | ImGuiContext& g = *GImGui; |
| 14979 | if (g.LogEnabled) |
| 14980 | return; |
| 14981 | |
| 14982 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 14983 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 14984 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 14985 | if (!filename) |
| 14986 | filename = g.IO.LogFilename; |
| 14987 | if (!filename || !filename[0]) |
| 14988 | return; |
| 14989 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 14990 | if (!f) |
| 14991 | { |
| 14992 | IM_ASSERT(0); |
| 14993 | return; |
| 14994 | } |
| 14995 | |
| 14996 | LogBegin(ImGuiLogFlags_OutputFile, auto_open_depth); |
| 14997 | g.LogFile = f; |
| 14998 | } |
| 14999 | |
| 15000 | // Start logging/capturing text output to clipboard |
| 15001 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected