MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / LogToFile

Method LogToFile

ImGUI GLFW Tutorial/imgui/imgui.cpp:10204–10226  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected