diff --git a/lib/settings.dart b/lib/settings.dart index 039f4093..a1e5fc54 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -471,8 +471,15 @@ class DebugLogger { if (_logPath?.isEmpty ?? true) { return; } + String message = record.message; + if (record.error != null) { + message += "\nERROR MESSAGE: ${record.error}"; + } + if (record.stackTrace != null) { + message += "\nSTACKTRACE:\n${record.stackTrace}\n\n"; + } File(_logPath!).writeAsStringSync( - "${record.time}: [${record.loggerName} - ${record.level.name}] ${record.message}\n", + "${record.time}: [${record.loggerName} - ${record.level.name}] $message\n", mode: FileMode.append, flush: true, );