-
Notifications
You must be signed in to change notification settings - Fork 0
Logging
Voltstro edited this page Jul 10, 2020
·
1 revision
Logging is an important aspect to any program. It can tell you and your users what and where it went wrong, display data in a easy way to access.
By default, VoltstroEngine logs to both the console/terminal that appears when you run a game, as well as to a log file in the /Logs
directory.
To log, all you need to do is:
Logger.Info("Message");
The logger supports info, warn, error and debug. You might have notice that each function provides a bunch load of overloads, what are these about? Well VoltstroEngine uses a logging library called Serilog for its logging, but what is so special about this logger?
Well, Serilog is built with powerful structured event data in mind. So you can do stuff like this:
int value = 124;
Logger.Info("The value is {@Value}", value);
You can read more about Serilog on their website.