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

Side by Side Diff: pkg/csslib/lib/src/messages.dart

Issue 304603003: Make source map location information more readable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | pkg/csslib/pubspec.yaml » ('j') | 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 csslib.src.messages; 5 library csslib.src.messages;
6 6
7 import 'package:logging/logging.dart' show Level; 7 import 'package:logging/logging.dart' show Level;
8 import 'package:source_maps/span.dart' show Span; 8 import 'package:source_maps/span.dart' show Span;
9 9
10 import 'options.dart'; 10 import 'options.dart';
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 var output = new StringBuffer(); 53 var output = new StringBuffer();
54 bool colors = useColors && _ERROR_COLORS.containsKey(level); 54 bool colors = useColors && _ERROR_COLORS.containsKey(level);
55 var levelColor = _ERROR_COLORS[level]; 55 var levelColor = _ERROR_COLORS[level];
56 if (colors) output.write(levelColor); 56 if (colors) output.write(levelColor);
57 output..write(_ERROR_LABEL[level])..write(' '); 57 output..write(_ERROR_LABEL[level])..write(' ');
58 if (colors) output.write(NO_COLOR); 58 if (colors) output.write(NO_COLOR);
59 59
60 if (span == null) { 60 if (span == null) {
61 output.write(message); 61 output.write(message);
62 } else { 62 } else {
63 output.write('on ');
63 output.write(span.getLocationMessage(message, useColors: colors, 64 output.write(span.getLocationMessage(message, useColors: colors,
64 color: levelColor)); 65 color: levelColor));
65 } 66 }
66 67
67 return output.toString(); 68 return output.toString();
68 } 69 }
69 } 70 }
70 71
71 typedef void PrintHandler(Message obj); 72 typedef void PrintHandler(Message obj);
72 73
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 119 }
119 120
120 /** Merge [newMessages] to this message lsit. */ 121 /** Merge [newMessages] to this message lsit. */
121 void mergeMessages(Messages newMessages) { 122 void mergeMessages(Messages newMessages) {
122 messages.addAll(newMessages.messages); 123 messages.addAll(newMessages.messages);
123 newMessages.messages.where((message) => 124 newMessages.messages.where((message) =>
124 message.level.value == Level.SEVERE || options.verbose) 125 message.level.value == Level.SEVERE || options.verbose)
125 .forEach((message) { printHandler(message); }); 126 .forEach((message) { printHandler(message); });
126 } 127 }
127 } 128 }
OLDNEW
« no previous file with comments | « no previous file | pkg/csslib/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698