What is the best solution for error logging?

Hi guys, it’s me again,

still early in development but I gave my current game (the compiled folder aka Debug) to a friend so he could try it on his computer.
Works great, but the game crashes when his mouse leaves the game window. Strange error, but reproducable on another Windows 10 PC.

I have no idea where this could come from, anyways it’s not getting caught by a simple try { } catch{ write to io stream error.text } around the
main game, which i just set up.

How do i properly set up error logging?

Regards
Kosmonaut

This is something that interests me to so anyone input would be appreciated.

Unless making something like crash report (and be able to handle it in order to make it useful), I’m afraid there is nothing to do, as games and game’s frameworks depends on so much variable (OS configuration, hardware, drivers, settings, operating condition, human factor, etc) what could you possibly log to anything in order to track down any issue ?

I’ve worked a lot on backend tasks and there, there are a lot of clearly defined running conditions which make it possible to log relevant data (particularly useful for multi-threaded program which are impossible to debug), such model is not applicable to game.

For your issue kosmonautgames, you can narrow down the perimeter by having a simple game which open a window a manage mouse, if it crash too, you will get some clue, if not, add one feature then retry and so on.

I fixed the issue, thanks.

Am now using an extenral logger wrapped and exception wrapped around the main.run()