NBlood icon indicating copy to clipboard operation
NBlood copied to clipboard

initprintf also log to nblood.log (issue #610)

Open Die4Ever opened this issue 1 year ago • 5 comments

I'm not sure if this would be too verbose but it could probably help people file bug reports or diagnose any issues

https://github.com/nukeykt/NBlood/issues/610

Die4Ever avatar Jul 22 '22 10:07 Die4Ever

Since this is in Build and not only for Blood, the comment is not precise because it is not necessarily just nblood.log. Other games log to different filenames.

CommonLoon102 avatar Jul 22 '22 12:07 CommonLoon102

Since this is in Build and not only for Blood, the comment is not precise because it is not necessarily just nblood.log. Other games log to different filenames.

fixed that comment, this pull request can be squash merged to avoid the pointless extra commit

Die4Ever avatar Jul 22 '22 13:07 Die4Ever

I've asked about this, and TerminX has confirmed my assumption. Basically, initprintf is supposed to be used only for messages printed to the startup window. In order to log to a file, you can use either one of the newer logging functions, or OSD_Printf.

In the case of NBlood's map crc check, the check itself exists in the relevant DOS version; I don't know if the use of initprintf was a mistake or not.

NY00123 avatar Jul 23 '22 06:07 NY00123

I've asked about this, and TerminX has confirmed my assumption. Basically, initprintf is supposed to be used only for messages printed to the startup window. In order to log to a file, you can use either one of the newer logging functions, or OSD_Printf.

In the case of NBlood's map crc check, the check itself exists in the relevant DOS version; I don't know if the use of initprintf was a mistake or not.

Maybe you would be able to see the message if you're starting a dedicated server?

So we should probably instead fix Blood's dbLoadMap function to make it log to both? Or we should make a new function in db.cpp that logs to both, call it like mapLoadLog or something

Die4Ever avatar Jul 23 '22 07:07 Die4Ever

I heard a bit more. Fixing the NBlood code indeed looks like the right answer.

initprintf calls initputs, which used to call OSD_Puts in older versions of EDuke32 (and JFBuild). So in older versions of NBlood, the call to initprintf did print the message to file. Maybe this was done like that so not all calls to initprintf (used after game startup) would have to be replaced with OSD_Printf.

With the transition to the newer logging functions (using loguru), this was changed, due to concerns like the ability to print things from different threads.

NY00123 avatar Jul 23 '22 09:07 NY00123

Thanks!

sirlemonhead avatar Sep 24 '22 15:09 sirlemonhead

The changes have been reverted for this specific PR. See the comments written in this PR earlier; The change should be in the Blood tree instead of the Build Engine.

NY00123 avatar Sep 24 '22 17:09 NY00123