redirecting debug output to a file on Windows
Lubomir I. Ivanov
neolit123 at gmail.com
Thu Feb 2 11:51:47 PST 2017
On 2 February 2017 at 21:35, Dirk Hohndel <dirk at hohndel.org> wrote:
> On Thu, Feb 02, 2017 at 09:33:32PM +0200, Lubomir I. Ivanov wrote:
>> On 2 February 2017 at 21:12, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> > const char *location = logfile ? "subsurface.log" : "CON";
>> > console_desc.out = freopen(location, "w", stdout);
>> > console_desc.err = freopen(location, "w", stderr);
>> ^ this *probably* won't work for stderr, though.
> That sucks as the debug output all goes to stderr :-(
attached is updated patch to write separate output files:
using something like:
to redirect stderr to stdout doesn't seem to work on windows, and even
if it does it will probably have buffer sync issues.
the real, clean solution, of course is to redirect from the CMD line,
but i have no idea why it no longer works.
i'm pretty sure that i've tried that and it worked when i wrote the
custom console code for windows.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6040 bytes
Desc: not available
More information about the subsurface