Adds functions to log and display errors.