redirecting debug output to a file on Windows

Lubomir I. Ivanov neolit123 at gmail.com
Thu Feb 2 11:12:19 PST 2017


On 2 February 2017 at 18:37, Dirk Hohndel <dirk at hohndel.org> wrote:
> Lubomir (and others)
>
> I know this used to work, but somehow it doesn't any more...
>
> subsurface.exe 1> dbg.txt 2>&1
>
> instead this prints to stdout and dbg.txt stays completely empty.
>
> Any idea how I can get it to do what I want to do (i.e., collect all
> output in a file)?
>

the command line redirection (>) isn't working and i don't know why. i
wonder if it ever worked.
tried like 5 different solutions, to no avail.

alternative solution / patch attached.

what it does:
- uses a new win32 specific command line argument --win32log
- the freopen() call in windows.c::subsurface_console_init() now knows
if we want to log the output to a file or to the CON (console)
"device"
- eventually it can both output to the console and write to a file

you can apply it and use like so:
cd <subsurface-path>
subsurface.exe --win32log -v -v -v

a file subsurface.log will be written.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Win32-add-the-win32log-option-to-log-stdout-and-stde.patch
Type: text/x-patch
Size: 5927 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170202/54179cbd/attachment-0001.bin>


More information about the subsurface mailing list