Start logging/capturing text output to given file
| 10206 | |
| 10207 | // Start logging/capturing text output to given file |
| 10208 | void ImGui::LogToFile(int auto_open_depth, const char* filename) |
| 10209 | { |
| 10210 | ImGuiContext& g = *GImGui; |
| 10211 | if (g.LogEnabled) |
| 10212 | return; |
| 10213 | |
| 10214 | // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still |
| 10215 | // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE. |
| 10216 | // By opening the file in binary mode "ab" we have consistent output everywhere. |
| 10217 | if (!filename) |
| 10218 | filename = g.IO.LogFilename; |
| 10219 | if (!filename || !filename[0]) |
| 10220 | return; |
| 10221 | ImFileHandle f = ImFileOpen(filename, "ab"); |
| 10222 | if (!f) |
| 10223 | { |
| 10224 | IM_ASSERT(0); |
| 10225 | return; |
| 10226 | } |
| 10227 | |
| 10228 | LogBegin(ImGuiLogType_File, auto_open_depth); |
| 10229 | g.LogFile = f; |
| 10230 | } |
| 10231 | |
| 10232 | // Start logging/capturing text output to clipboard |
| 10233 | void ImGui::LogToClipboard(int auto_open_depth) |
nothing calls this directly
no test coverage detected