SimonN / LixD

Lix: Lemmings-like game with puzzles, editor, multiplayer
https://www.lixgame.com
132 stars 17 forks source link

Logging (user/log.txt): Exceptions during init aren't logged #488

Closed SimonN closed 5 months ago

SimonN commented 7 months ago

Lix 0.10.22

  1. Delete ./data/images/lixrecol.png or put the 0.10.22 binary in a 0.9.47 tree.
  2. Run Lix.
  3. The missing image from step 1 produces a runtime exception during initialization (i.e., before the main loop) that prevents Lix from running normally.
  4. Observe Lix terminate. If you have a shell, observe the exception on stderr.
  5. Look in the log file ./user/log.txt.

Expected: The log file shows the exception from step 4.

Instead: The log file doesn't show this error.

The logging system inits only after A5 initializes. Let's init the logging earlier. Write a try-catch-all clause around the init code.

SimonN commented 7 months ago

I'll fix this in Lix 0.10.23.