logError method

Future<void> logError(
  1. Object error,
  2. StackTrace stack
)

Outputs error to log file

Implementation

Future<void> logError(Object error, StackTrace stack) async{
  if (!_isInit) return;
  final file = loggingDir / "errors.log";
  await file.writeAsString("${DateTime.now().timeStamp} $error $stack\n", mode: FileMode.writeOnlyAppend);
}