MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / LogToFile

Method LogToFile

engine/3rdparty/imgui/imgui.cpp:11931–11953  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

11929
11930// Start logging/capturing text output to given file
11931void ImGui::LogToFile(int auto_open_depth, const char* filename)
11932{
11933 ImGuiContext& g = *GImGui;
11934 if (g.LogEnabled)
11935 return;
11936
11937 // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still
11938 // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE.
11939 // By opening the file in binary mode "ab" we have consistent output everywhere.
11940 if (!filename)
11941 filename = g.IO.LogFilename;
11942 if (!filename || !filename[0])
11943 return;
11944 ImFileHandle f = ImFileOpen(filename, "ab");
11945 if (!f)
11946 {
11947 IM_ASSERT(0);
11948 return;
11949 }
11950
11951 LogBegin(ImGuiLogType_File, auto_open_depth);
11952 g.LogFile = f;
11953}
11954
11955// Start logging/capturing text output to clipboard
11956void ImGui::LogToClipboard(int auto_open_depth)

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected