OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library analysis.logger; |
| 6 |
| 7 import 'package:analyzer/src/generated/engine.dart'; |
| 8 import 'package:logging/logging.dart' as logging; |
| 9 |
| 10 /** |
| 11 * Instances of the class [AnalysisLogger] translate from the analysis engine's |
| 12 * API to the logging package's API. |
| 13 */ |
| 14 class AnalysisLogger implements Logger { |
| 15 /** |
| 16 * The underlying logger that is being wrapped. |
| 17 */ |
| 18 final logging.Logger baseLogger = new logging.Logger('analysis.server'); |
| 19 |
| 20 @override |
| 21 void logError(String message) { |
| 22 baseLogger.severe(message); |
| 23 } |
| 24 |
| 25 @override |
| 26 void logError2(String message, Exception exception) { |
| 27 baseLogger.severe(message, exception); |
| 28 } |
| 29 |
| 30 @override |
| 31 void logError3(Exception exception) { |
| 32 baseLogger.severe("Exception", exception); |
| 33 } |
| 34 |
| 35 @override |
| 36 void logInformation(String message) { |
| 37 baseLogger.info(message); |
| 38 } |
| 39 |
| 40 @override |
| 41 void logInformation2(String message, Exception exception) { |
| 42 baseLogger.info(message, exception); |
| 43 } |
| 44 } |
OLD | NEW |