MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / LogToFile

Method LogToFile

TheForceEngine/TFE_Ui/imGUI/imgui.cpp:13686–13708  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

13684
13685// Start logging/capturing text output to given file
13686void ImGui::LogToFile(int auto_open_depth, const char* filename)
13687{
13688 ImGuiContext& g = *GImGui;
13689 if (g.LogEnabled)
13690 return;
13691
13692 // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still
13693 // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE.
13694 // By opening the file in binary mode "ab" we have consistent output everywhere.
13695 if (!filename)
13696 filename = g.IO.LogFilename;
13697 if (!filename || !filename[0])
13698 return;
13699 ImFileHandle f = ImFileOpen(filename, "ab");
13700 if (!f)
13701 {
13702 IM_ASSERT(0);
13703 return;
13704 }
13705
13706 LogBegin(ImGuiLogType_File, auto_open_depth);
13707 g.LogFile = f;
13708}
13709
13710// Start logging/capturing text output to clipboard
13711void ImGui::LogToClipboard(int auto_open_depth)

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected