Logging on windows

Bug #1398536 reported by Tino
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

Since the switch to SDL2 widelands does not create stderr.txt and stdout.txt any longer .

I've done some research, and it seems on windows it is decided at compile time (-mwindow vs. mconsole) if a program can log to stdout and if this is visible when the application is started in a commandshell.

My current goal is:
- If i call "widelands.exe --help || --version" in a windows commandshell i would like widelands to directly output the information into this console
- Running widelands.exe via startmenu -> current status quo, discard any output
- Running widelands.exe in a windows commandshell : output stdout and log into this console
- Running "widelands.exe --enable_log" log stdout and stderr into ~\.widelands\stdout.txt and stderr.txt

I've tried to implement the last use case in my branch, but now i am stuck:
- with enable_log both files get created at start
- only stderr.txt contains information on every run. stdout.txt does only contain information if i start widelands out of Codeblocks IDE. If i call the binary from a commandshell, stdout.txt stays empty.

Related branches

Tino (tino79)
Changed in widelands:
importance: Undecided → Low
assignee: nobody → Tino (tino79)
tags: added: regression windows
Revision history for this message
Tino (tino79) wrote :

SirVer has fixed this for B19.

ToDo:
- Write the logfile to ~\.widelands and not into the install dir

Changed in widelands:
status: New → Triaged
milestone: none → build20-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :

The logfile also seems to miss output from exceptions - do we need to generate a separate stderr.txt?

GunChleoc (gunchleoc)
Changed in widelands:
assignee: Tino (tino79) → GunChleoc (gunchleoc)
status: Triaged → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote :

@Tino: Are you happy with the current state of affairs, or do you wish for a more elaborate algorithm?

Changed in widelands:
status: In Progress → Confirmed
assignee: GunChleoc (gunchleoc) → Tino (tino79)
Revision history for this message
Tino (tino79) wrote :

Cool, thank you for implementing this!

There is still the problem, that STDERR gets lost in windows, error messages are neither printed to console nor to the stdout.txt.
But i think this is a SDL2 issue and maybe worth another bug...

Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks for your feedback, I have created a follow-up bug

https://bugs.launchpad.net/widelands/+bug/1792521

Changed in widelands:
status: Confirmed → Fix Committed
assignee: Tino (tino79) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.