exception static method
exception
method to handle exceptions and log them with error log level.
Implementation
static void exception(Object exception, {StackTrace? stackTrace}) {
final message = exception.toString();
_instance._logger.error(
message,
null,
stackTrace,
);
}