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

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

Issue 149243009: Add support for lazy transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('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) 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.transform_logger; 5 library barback.transform_logger;
6 6
7 import 'package:source_maps/span.dart'; 7 import 'package:source_maps/span.dart';
8 8
9 import 'asset_id.dart'; 9 import 'asset_id.dart';
10 import 'log.dart'; 10 import 'log.dart';
11 import 'transform.dart'; 11
12 typedef void LogFunction(AssetId asset, LogLevel level, String message,
13 Span span);
12 14
13 /// Object used to report warnings and errors encountered while running a 15 /// Object used to report warnings and errors encountered while running a
14 /// transformer. 16 /// transformer.
15 class TransformLogger { 17 class TransformLogger {
16 final LogFunction _logFunction; 18 final LogFunction _logFunction;
17 19
18 TransformLogger(this._logFunction); 20 TransformLogger(this._logFunction);
19 21
20 /// Logs an informative message. 22 /// Logs an informative message.
21 /// 23 ///
(...skipping 19 matching lines...) Expand all
41 /// 43 ///
42 /// If [asset] is provided, the log entry is associated with that asset. 44 /// If [asset] is provided, the log entry is associated with that asset.
43 /// Otherwise it's associated with the primary input of [transformer]. 45 /// Otherwise it's associated with the primary input of [transformer].
44 /// If present, [span] indicates the location in the input asset that caused 46 /// If present, [span] indicates the location in the input asset that caused
45 /// the error. 47 /// the error.
46 // TODO(sigmund,nweiz): clarify when an error should be logged or thrown. 48 // TODO(sigmund,nweiz): clarify when an error should be logged or thrown.
47 void error(String message, {AssetId asset, Span span}) { 49 void error(String message, {AssetId asset, Span span}) {
48 _logFunction(asset, LogLevel.ERROR, message, span); 50 _logFunction(asset, LogLevel.ERROR, message, span);
49 } 51 }
50 } 52 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698