fatal static method
void
fatal(})
Implementation
static void fatal(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace, bool isReport = true, required String actionModule, required String actionName}) {
if (isLogPathInitialized(message)) {
try {
if (isMobile) {
MXLogger.instance.fatal(message, name: actionModule, tag: actionName);
} else {
logger.f(
jsonEncode({
"time": time?.toIso8601String() ?? DateTime.now().toIso8601String(),
"sequence": TCICLog.sequence,
"message": message,
"actionModule": actionModule,
"actionName": actionName,
"error": error.toString(),
"stackTrace": stackTrace?.toString(),
}),
time: time ?? DateTime.now(),
error: error,
stackTrace: stackTrace ?? StackTrace.current,
);
}
} catch (_) {}
if (isReport) {
TCICLog.incrementSequence();
report(TCICLogParam(sequence: TCICLog.sequence, module: actionModule, action: actionName, param: message, level: "fatal", code: -4, desc: "Fatal error", stack: stackTrace.toString()));
}
}
}