MCPcopy Create free account
hub / github.com/RenderKit/embree / LogToFile

Method LogToFile

tutorials/common/imgui/imgui.cpp:12185–12207  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

12183
12184// Start logging/capturing text output to given file
12185void ImGui::LogToFile(int auto_open_depth, const char* filename)
12186{
12187 ImGuiContext& g = *GImGui;
12188 if (g.LogEnabled)
12189 return;
12190
12191 // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still
12192 // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE.
12193 // By opening the file in binary mode "ab" we have consistent output everywhere.
12194 if (!filename)
12195 filename = g.IO.LogFilename;
12196 if (!filename || !filename[0])
12197 return;
12198 ImFileHandle f = ImFileOpen(filename, "ab");
12199 if (!f)
12200 {
12201 IM_ASSERT(0);
12202 return;
12203 }
12204
12205 LogBegin(ImGuiLogType_File, auto_open_depth);
12206 g.LogFile = f;
12207}
12208
12209// Start logging/capturing text output to clipboard
12210void ImGui::LogToClipboard(int auto_open_depth)

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected