FS#5722 - Add news messages to crashlog

Attached to Project: OpenTTD
Opened by Charles Pigott (LordAro) - Saturday, 24 August 2013, 12:10 GMT
Last edited by andythenorth (andythenorth) - Saturday, 02 September 2017, 12:22 GMT
Type Feature Request
Category Core
Status With patch
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


As per the Todo list, i have added pending news messages to the crashlog

hg patch queue, based on r25739
patch 02_ isn't strictly necessary, but is nice to have :)

However, i would like some feedback regarding patch 03 -
Alberth pointed out to me that converting StringIDs to text after a crash probably isn't very safe.
So, should i store a char* of the message in the NewsItem object, or just list the relevant numbers from the NewsItem? Or something else altogether?
This task depends upon

Comment by frosch (frosch) - Sunday, 06 October 2013, 10:31 GMT
Does 01 change anything, or does it only move functions?
While a function name "GetReferenceTile" is fine when it is static to a file, it's not exactly suitable for a globally accessible thing.

Wrt. 03:
WriteNewsString definitely needs a "last" parameter to denote the end of the buffer.
"(%i-%i-%i) %s\n" could be "(%i-%02i-%02i) %s\n"
But I agree with Albert. The text message might be troublesome, since news serveral times caused crashes in the past, when they referenced invalid entities from the past. So, maybe print NewsItem members: type, references, stringid, stringparams
Comment by andythenorth (andythenorth) - Thursday, 24 August 2017, 19:34 GMT
frosch123: andythenorth: it's on the offical todo list
LordAro: andythenorth: i think it could probably be finished relatively easily