From a69a1bc023ec34a09a19bbadb7c4e7997e6cbc9a Mon Sep 17 00:00:00 2001 From: Luiz Mineo Date: Thu, 28 Aug 2014 20:08:40 -0300 Subject: [PATCH] Fix: Correctly log an exception when no stack trace is provided --- CHANGELOG.md | 3 +++ lib/src/logger.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 317e472..1116b80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.5.15 +* Fix: Correctly log an exception when no stack trace is provided + ## v0.5.14 * Fix: `Manager.findMethods()` should include inherited methods. diff --git a/lib/src/logger.dart b/lib/src/logger.dart index 378245e..fe837f9 100644 --- a/lib/src/logger.dart +++ b/lib/src/logger.dart @@ -7,8 +7,8 @@ void setupConsoleLog([Level level = Level.INFO]) { Logger.root.level = level; Logger.root.onRecord.listen((LogRecord rec) { if (rec.level >= Level.SEVERE) { - var stack = rec.stackTrace != null ? rec.stackTrace : ""; - print('${rec.level.name}: ${rec.time}: ${rec.message} - ${rec.error}\n${Trace.format(stack)}'); + var stack = rec.stackTrace != null ? "\n${Trace.format(rec.stackTrace)}" : ""; + print('${rec.level.name}: ${rec.time}: ${rec.message} - ${rec.error}${stack}'); } else { print('${rec.level.name}: ${rec.time}: ${rec.message}'); } diff --git a/pubspec.yaml b/pubspec.yaml index 57110d5..543365b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: redstone -version: 0.5.14 +version: 0.5.15 author: Luiz Mineo description: A metadata driven microframework for Dart homepage: http://redstonedart.org