Logging in a production environment

What is the best practice for logging arbitrary data or errors in a production environment? If a player runs into an app crash for example, there should be some log file they could send for inspection.

I see this in game.project:

Screenshot 2023-02-15 145110

…however I’m not sure this is acceptable for an end user after downloading the game. There is also this library:

It might not be a big deal and I am overthinking it.

When the engine crashes it writes a _crash file. This file can be read and parsed on next startup using crash.* functions.

You can also catch Lua errors by setting an error handler:

The next question is what to do with the data? You can write it to a log file like you suggest, but a much better solution is to also collect this data using some service, for instance Sentry.

On iOS and Android this data is collected automatically for you by Apple and Google.

1 Like