Logging on windows
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\
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
- hessenfarmer: Approve
-
Diff: 334 lines (+88/-34)10 files modifiedsrc/CMakeLists.txt (+0/-2)
src/base/CMakeLists.txt (+1/-0)
src/base/log.cc (+39/-11)
src/base/log.h (+9/-0)
src/economy/test/CMakeLists.txt (+1/-0)
src/economy/test/test_road.cc (+6/-0)
src/main.cc (+6/-12)
src/notifications/test/CMakeLists.txt (+1/-0)
src/notifications/test/notifications_test.cc (+5/-0)
src/wlapplication.cc (+20/-9)
Changed in widelands: | |
importance: | Undecided → Low |
assignee: | nobody → Tino (tino79) |
tags: | added: regression windows |
Changed in widelands: | |
assignee: | Tino (tino79) → GunChleoc (gunchleoc) |
status: | Triaged → In Progress |
SirVer has fixed this for B19.
ToDo:
- Write the logfile to ~\.widelands and not into the install dir