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

Side by Side Diff: pkg/barback/lib/src/package_graph.dart

Issue 166333003: Add support for a "fine" barback log level. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 barback.package_graph; 5 library barback.package_graph;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset_cascade.dart'; 9 import 'asset_cascade.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // doesn't start building until some source in that graph is updated. 77 // doesn't start building until some source in that graph is updated.
78 _cascadeResults[package] = new BuildResult.success(); 78 _cascadeResults[package] = new BuildResult.success();
79 _cascades[package] = cascade; 79 _cascades[package] = cascade;
80 cascade.onDirty.listen((_) { 80 cascade.onDirty.listen((_) {
81 _cascadeResults[package] = null; 81 _cascadeResults[package] = null;
82 }); 82 });
83 83
84 cascade.onLog.listen((entry) { 84 cascade.onLog.listen((entry) {
85 if (_logController.hasListener) { 85 if (_logController.hasListener) {
86 _logController.add(entry); 86 _logController.add(entry);
87 } else { 87 } else if (entry.level != LogLevel.FINE) {
88 // No listeners, so just print entry. 88 // No listeners, so just print entry.
89 var buffer = new StringBuffer(); 89 var buffer = new StringBuffer();
90 buffer.write("[${entry.level} ${entry.transform}] "); 90 buffer.write("[${entry.level} ${entry.transform}] ");
91 91
92 if (entry.span != null) { 92 if (entry.span != null) {
93 buffer.write(entry.span.getLocationMessage(entry.message)); 93 buffer.write(entry.span.getLocationMessage(entry.message));
94 } else { 94 } else {
95 buffer.write(entry.message); 95 buffer.write(entry.message);
96 } 96 }
97 97
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (cascade == null) throw new ArgumentError("Unknown package $package."); 191 if (cascade == null) throw new ArgumentError("Unknown package $package.");
192 cascade.removeSources(ids); 192 cascade.removeSources(ids);
193 }); 193 });
194 } 194 }
195 195
196 void updateTransformers(String package, 196 void updateTransformers(String package,
197 Iterable<Iterable<Transformer>> transformers) { 197 Iterable<Iterable<Transformer>> transformers) {
198 _cascades[package].updateTransformers(transformers); 198 _cascades[package].updateTransformers(transformers);
199 } 199 }
200 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698