Opened 11 years ago

Closed 10 years ago

Last modified 12 months ago

#7639 closed enhancement (wontfix)

WII: A way to save debug output to a file

Reported by: SF/small_horse Owned by: dhewg
Priority: normal Component: Port: Wii
Keywords: Cc:
Game:

Description

For crash-analysis as well as other game issues etc. it would be very handy if the GUI would allow a logfile to be created.

Eg. in the ScummVM Options make a new Option "Save Debug-Output to Logfile" which when activated will save debug-output to a file on the SD-Card in the ScummVM directory (eg. debug.log)

If some issues occur this file can be read on a PC and information from it can be helpful in bug-reports etc.

Currently I don't know of a way to see the ScummVM output on the Wii console.

Ticket imported from: #1998670. Ticket imported from: feature-requests/455.

Change History (7)

comment:1 by jvprat, 11 years ago

Owner: set to dhewg

comment:2 by jvprat, 11 years ago

It's an interesting feature. I think at least the Windows CE port already implements it (it looks for a config option and it generates a file for stdout and another one for stderr), so it could be used as a reference.

comment:3 by dhewg, 11 years ago

While it's easy to freopen() stdout/err, a logfile should always contain the latest output, no matter where ScummVM crashes (if, that is ;). Flushing the content after each linefeed might become a performance issue, i'll look into it.

But currently there seems to be a problem with dkppc r16 and stderr in combination with va_args, which should be sorted out first.

comment:4 by dhewg, 10 years ago

Resolution: wontfix
Status: newclosed

comment:5 by dhewg, 10 years ago

I checked how to realise this, and I'm sorry to reject this FR.

Applications on Wii run on bare metal, there is not underlying OS (in contrast to the mentioned WinCE). All low level I/O access is linked into each app. If it crashes, there is no layer to flush caches, properly close opened file descriptors or unmount filesystems.
For read-only access, this is no real problem, but having open and writeable file descriptors with unflushed data is dangerous. Losing control due to crashes, abort()s, asserts() or _exit()s can leave the FAT filesystem in a inconsistent state.
So there really is only one way to make it safe: for every line that gets printed, open the log, append a line of text and close it again. And that is incredible slow with Wii homebrew libs.
At this price the feature isn't worth it IMHO.

comment:6 by dhewg, 10 years ago

fyI: since yesterday, there's an on-screen console for the wii port on trunk. it can be enabled with the padcombo dpad up+R/1. when scummvm exits with return code != 0, or quits abnormal (_exit(), abort(), assert()), this console is automatically shown prior to returning to the launcher.

comment:7 by digitall, 12 months ago

Component: Port: Wii
Note: See TracTickets for help on using tickets.