MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / LogToFile

Method LogToFile

lib/imgui/imgui.cpp:9337–9359  ·  view source on GitHub ↗

Start logging/capturing text output to given file

Source from the content-addressed store, hash-verified

9335
9336// Start logging/capturing text output to given file
9337void ImGui::LogToFile(int auto_open_depth, const char* filename)
9338{
9339 ImGuiContext& g = *GImGui;
9340 if (g.LogEnabled)
9341 return;
9342
9343 // FIXME: We could probably open the file in text mode "at", however note that clipboard/buffer logging will still
9344 // be subject to outputting OS-incompatible carriage return if within strings the user doesn't use IM_NEWLINE.
9345 // By opening the file in binary mode "ab" we have consistent output everywhere.
9346 if (!filename)
9347 filename = g.IO.LogFilename;
9348 if (!filename || !filename[0])
9349 return;
9350 ImFileHandle f = ImFileOpen(filename, "ab");
9351 if (!f)
9352 {
9353 IM_ASSERT(0);
9354 return;
9355 }
9356
9357 LogBegin(ImGuiLogType_File, auto_open_depth);
9358 g.LogFile = f;
9359}
9360
9361// Start logging/capturing text output to clipboard
9362void ImGui::LogToClipboard(int auto_open_depth)

Callers

nothing calls this directly

Calls 1

ImFileOpenFunction · 0.70

Tested by

no test coverage detected