It would be nice to use a logging library or a more standard way to log errors, especially with a good formatting