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

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

Issue 199723002: Improve the documentation for [TransformLogger.error]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 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 | « no previous file | 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) 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';
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void warning(String message, {AssetId asset, Span span}) { 49 void warning(String message, {AssetId asset, Span span}) {
50 _logFunction(asset, LogLevel.WARNING, message, span); 50 _logFunction(asset, LogLevel.WARNING, message, span);
51 } 51 }
52 52
53 /// Logs an error message. 53 /// Logs an error message.
54 /// 54 ///
55 /// If [asset] is provided, the log entry is associated with that asset. 55 /// If [asset] is provided, the log entry is associated with that asset.
56 /// Otherwise it's associated with the primary input of [transformer]. 56 /// Otherwise it's associated with the primary input of [transformer].
57 /// If present, [span] indicates the location in the input asset that caused 57 /// If present, [span] indicates the location in the input asset that caused
58 /// the error. 58 /// the error.
59 // TODO(sigmund,nweiz): clarify when an error should be logged or thrown. 59 ///
60 /// Logging any errors will cause Barback to consider the transformation to
61 /// have failed, much like throwing an exception. This means that neither the
62 /// primary input nor any outputs emitted by the transformer will be passed on
63 /// to the following phase, and the build will be reported as having failed.
64 ///
65 /// Unlike throwing an exception, this doesn't cause a transformer to stop
66 /// running. This makes it useful in cases where a single input may have
67 /// multiple errors that the user wants to know about.
60 void error(String message, {AssetId asset, Span span}) { 68 void error(String message, {AssetId asset, Span span}) {
61 _logFunction(asset, LogLevel.ERROR, message, span); 69 _logFunction(asset, LogLevel.ERROR, message, span);
62 } 70 }
63 } 71 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698