From 880b05d2beb4992a2a1fc8b67fd726d74ba48505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio?= Date: Fri, 7 Apr 2023 23:17:27 -0300 Subject: [PATCH] now prints to stderr --- CHANGELOG.md | 2 ++ lib/pubspec.dart | 2 +- lib/src/var_dump.dart | 3 ++- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8247d95..2df5c77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## v0.5.0 +- now prints to stderr ## v0.4.3 - better score ## v0.4.2 diff --git a/lib/pubspec.dart b/lib/pubspec.dart index a12075a..41d7ace 100644 --- a/lib/pubspec.dart +++ b/lib/pubspec.dart @@ -2,7 +2,7 @@ const name = 'var_dump'; const description = 'Dumps details in tree from variable. Optionally exits. Can use dump() or var_dump(), or dd() for "dump and die"'; -const version = '0.4.3'; +const version = '0.5.0'; const repository = 'https://github.com/insign/dart_var_dump'; const homepage = 'https://github.com/insign/dart_var_dump'; const environment = '{sdk: >=2.17.0 <3.0.0}'; diff --git a/lib/src/var_dump.dart b/lib/src/var_dump.dart index 255e53b..b5c00e9 100644 --- a/lib/src/var_dump.dart +++ b/lib/src/var_dump.dart @@ -12,7 +12,8 @@ int level = 0; /// - [obj]: The variable to dump /// - [colorize]: Whether to colorize the output void dump(dynamic obj, {bool colorize = true}) { - print(analyse(obj, colorize: colorize)); + // prints to stderr to avoid messing up stdout + stderr.writeln(analyse(obj, colorize: colorize)); } /// Dump the variable to the console diff --git a/pubspec.yaml b/pubspec.yaml index d7b6b03..53ad412 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: var_dump description: 'Dumps details in tree from variable. Optionally exits. Can use dump() or var_dump(), or dd() for "dump and die"' -version: 0.4.3 +version: 0.5.0 repository: https://github.com/insign/dart_var_dump homepage: https://github.com/insign/dart_var_dump