TF-1984 Update logger by standard format

(cherry picked from commit 08110ffa7189d8f511fe8d69a948f37c695d667c)
This commit is contained in:
dab246
2023-08-30 16:20:51 +07:00
committed by Dat Vu
parent 5c7eb62eb7
commit bacf448b33
+4 -4
View File
@@ -40,13 +40,13 @@ void logError(String? value) => log(value, level: Level.error);
void initLogger(VoidCallback runApp) { void initLogger(VoidCallback runApp) {
runZonedGuarded(() async { runZonedGuarded(() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
FlutterError.onError = (FlutterErrorDetails details) { FlutterError.onError = (details) {
FlutterError.dumpErrorToConsole(details); FlutterError.dumpErrorToConsole(details);
logError(details.stack.toString()); logError('AppLogger::initLogger::runZonedGuarded:FlutterError.onError: ${details.stack.toString()}');
}; };
runApp.call(); runApp.call();
}, (Object error, StackTrace stack) { }, (error, stack) {
logError(stack.toString()); logError('AppLogger::initLogger::runZonedGuarded:onError: $error | stack: $stack');
}); });
} }