Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/source_file_provider.dart

Issue 12642004: Don't output tons of messages on apidoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/library_loader.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library source_file_provider; 5 library source_file_provider;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:uri'; 8 import 'dart:uri';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:utf'; 10 import 'dart:utf';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool enableColors = false; 61 bool enableColors = false;
62 bool throwOnError = false; 62 bool throwOnError = false;
63 63
64 final int FATAL = api.Diagnostic.CRASH.ordinal | api.Diagnostic.ERROR.ordinal; 64 final int FATAL = api.Diagnostic.CRASH.ordinal | api.Diagnostic.ERROR.ordinal;
65 final int INFO = 65 final int INFO =
66 api.Diagnostic.INFO.ordinal | api.Diagnostic.VERBOSE_INFO.ordinal; 66 api.Diagnostic.INFO.ordinal | api.Diagnostic.VERBOSE_INFO.ordinal;
67 67
68 FormattingDiagnosticHandler(SourceFileProvider this.provider); 68 FormattingDiagnosticHandler(SourceFileProvider this.provider);
69 69
70 void info(var message, [api.Diagnostic kind = api.Diagnostic.VERBOSE_INFO]) { 70 void info(var message, [api.Diagnostic kind = api.Diagnostic.VERBOSE_INFO]) {
71 if (!verbose && identical(kind, api.Diagnostic.VERBOSE_INFO)) return;
72 if (enableColors) { 71 if (enableColors) {
73 print('${colors.green("info:")} $message'); 72 print('${colors.green("info:")} $message');
74 } else { 73 } else {
75 print('info: $message'); 74 print('info: $message');
76 } 75 }
77 } 76 }
78 77
79 void diagnosticHandler(Uri uri, int begin, int end, String message, 78 void diagnosticHandler(Uri uri, int begin, int end, String message,
80 api.Diagnostic kind) { 79 api.Diagnostic kind) {
81 // TODO(ahe): Remove this when source map is handled differently. 80 // TODO(ahe): Remove this when source map is handled differently.
82 if (identical(kind.name, 'source map')) return; 81 if (identical(kind.name, 'source map')) return;
82 if (!verbose && identical(kind, api.Diagnostic.VERBOSE_INFO)) return;
83 83
84 if (isAborting) return; 84 if (isAborting) return;
85 isAborting = identical(kind, api.Diagnostic.CRASH); 85 isAborting = identical(kind, api.Diagnostic.CRASH);
86 bool fatal = (kind.ordinal & FATAL) != 0; 86 bool fatal = (kind.ordinal & FATAL) != 0;
87 bool isInfo = (kind.ordinal & INFO) != 0; 87 bool isInfo = (kind.ordinal & INFO) != 0;
88 if (isInfo && uri == null && !identical(kind, api.Diagnostic.INFO)) { 88 if (isInfo && uri == null && !identical(kind, api.Diagnostic.INFO)) {
89 info(message, kind); 89 info(message, kind);
90 return; 90 return;
91 } 91 }
92 var color; 92 var color;
(...skipping 23 matching lines...) Expand all
116 print(file.getLocationMessage(color(message), begin, end, true, color)); 116 print(file.getLocationMessage(color(message), begin, end, true, color));
117 } 117 }
118 if (fatal && throwOnError) { 118 if (fatal && throwOnError) {
119 isAborting = true; 119 isAborting = true;
120 throw new AbortLeg(message); 120 throw new AbortLeg(message);
121 } 121 }
122 } 122 }
123 } 123 }
124 124
125 125
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/library_loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698