sdpyPrintDebugString

Function to help temporarily print debugging info. It will bypass any stdout/err redirection and go to the controlling tty or console (attaching to the parent and/or allocating one as needed on Windows. Please note it may overwrite output from other programs in the parent and the allocated one will not survive if your program crashes. Use the fileOverride to print to a log file instead if you are in one of those situations).

It does not support outputting very many types; just strings and ints are likely to actually work.

It will perform very slowly and swallows any errors that may occur. Moreover, the specific output is unspecified meaning I can change it at any time. The only point of this function is to help in temporary use for printf-style debugging. It is NOT nogc, but you can use the debug keyword and the compiler will cheat for you. It is, however, formally nothrow and trusted to ease its use in those contexts.

I reserve the right to change this function at any time. You can use it if it helps you but do not rely on it for anything permanent.
nothrow @trusted
void
sdpyPrintDebugString
(
string fileOverride = null
T...
)
(
T t
)

Meta

History

Added December 3, 2021. Not formally supported under any stable tag.