Chromium Code Reviews| Index: pkg/analyzer/lib/src/analyzer_impl.dart |
| diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart |
| index aff85fb29043c605d5dd0863c8c03f766a1ffc17..2dac98e314b6affee2cf01ff046bab6ad4c1e936 100644 |
| --- a/pkg/analyzer/lib/src/analyzer_impl.dart |
| +++ b/pkg/analyzer/lib/src/analyzer_impl.dart |
| @@ -125,7 +125,7 @@ class AnalyzerImpl { |
| stdout.writeln("total:$totalTime"); |
| } |
| }).catchError((exception, stackTrace) { |
| - AnalysisEngine.instance.logger.logError(exception); |
| + AnalysisEngine.instance.logger.logError(exception.toString()); |
| }); |
| } |
| @@ -158,6 +158,8 @@ class AnalyzerImpl { |
| sourceFactory = new SourceFactory(resolvers); |
| context = AnalysisEngine.instance.createAnalysisContext(); |
| context.sourceFactory = sourceFactory; |
| + // Uncomment the following to have errors reported on stdout and stderr |
| +// AnalysisEngine.instance.logger = new StdLogger(); |
|
jwren
2014/03/11 23:53:37
Do we want an additional --verbose flag to enable
Brian Wilkerson
2014/03/12 13:19:18
I would probably call it "--debug", but it seems l
jwren
2014/03/12 16:28:44
Will add the flag in a follow up CL.
|
| // set options for context |
| AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); |
| @@ -259,3 +261,30 @@ class AnalyzerImpl { |
| return UriKind.FILE_URI; |
| } |
| } |
| + |
| +/** |
| + * This [Logger] prints out information comments to [stdout] and error messages |
| + * to [stderr]. |
| + */ |
| +class StdLogger extends Logger { |
| + |
| + @override |
| + void logError(String message) { |
| + stderr.writeln(message); |
| + } |
| + |
| + @override |
| + void logError2(String message, Exception exception) { |
| + stderr.writeln(message); |
| + } |
| + |
| + @override |
| + void logInformation(String message) { |
| + stdout.writeln(message); |
| + } |
| + |
| + @override |
| + void logInformation2(String message, Exception exception) { |
| + stdout.writeln(message); |
| + } |
| +} |