extended diagnostics

This commit is contained in:
Stephan D
2026-03-17 13:18:30 +01:00
parent 251c2a0dfc
commit c2c5ad7b3b
2 changed files with 15 additions and 3 deletions

View File

@@ -42,10 +42,17 @@ final _bootstrapLogger = Logger('bootstrap');
void _setupLogging() {
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen((record) {
// ignore: avoid_print
print(
final buffer = StringBuffer(
'${record.level.name}: ${record.time}: ${record.loggerName}: ${record.message}',
);
if (record.error != null) {
buffer.write('\nerror: ${record.error}');
}
if (record.stackTrace != null) {
buffer.write('\n${record.stackTrace}');
}
// ignore: avoid_print
print(buffer.toString());
});
}
@@ -65,7 +72,6 @@ void _setupErrorHandling() {
};
}
void main() async {
WidgetsFlutterBinding.ensureInitialized();
_setupLogging();