MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / LogToFile

Method LogToFile

include/imgui/imgui.cpp:15372–15394  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

15370
15371// Start logging/capturing text output to given file
15372void 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
15397void ImGui::LogToClipboard(int auto_open_depth)

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected