OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 pub.barback.asset_environment; | 5 library pub.barback.asset_environment; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // If the relevant asset isn't the primary input, mention it unless the | 666 // If the relevant asset isn't the primary input, mention it unless the |
667 // message already does. | 667 // message already does. |
668 if (entry.assetId != entry.transform.primaryId && | 668 if (entry.assetId != entry.transform.primaryId && |
669 !messageMentionsAsset(entry.assetId)) { | 669 !messageMentionsAsset(entry.assetId)) { |
670 prefixParts.add("with input ${entry.assetId}"); | 670 prefixParts.add("with input ${entry.assetId}"); |
671 } | 671 } |
672 | 672 |
673 var prefix = "[${prefixParts.join(' ')}]:"; | 673 var prefix = "[${prefixParts.join(' ')}]:"; |
674 var message = entry.message; | 674 var message = entry.message; |
675 if (entry.span != null) { | 675 if (entry.span != null) { |
676 message = entry.span.getLocationMessage(entry.message); | 676 message = entry.span.message(entry.message); |
677 } | 677 } |
678 | 678 |
679 switch (entry.level) { | 679 switch (entry.level) { |
680 case LogLevel.ERROR: | 680 case LogLevel.ERROR: |
681 log.error("${log.red(prefix)}\n$message"); | 681 log.error("${log.red(prefix)}\n$message"); |
682 break; | 682 break; |
683 | 683 |
684 case LogLevel.WARNING: | 684 case LogLevel.WARNING: |
685 log.warning("${log.yellow(prefix)}\n$message"); | 685 log.warning("${log.yellow(prefix)}\n$message"); |
686 break; | 686 break; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 String toString() => "polling"; | 741 String toString() => "polling"; |
742 } | 742 } |
743 | 743 |
744 class _NoneWatcherType implements WatcherType { | 744 class _NoneWatcherType implements WatcherType { |
745 const _NoneWatcherType(); | 745 const _NoneWatcherType(); |
746 | 746 |
747 DirectoryWatcher create(String directory) => null; | 747 DirectoryWatcher create(String directory) => null; |
748 | 748 |
749 String toString() => "none"; | 749 String toString() => "none"; |
750 } | 750 } |
OLD | NEW |