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

Side by Side Diff: pkg/analysis_server/lib/src/analysis_logger.dart

Issue 969113002: Reformat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | pkg/analysis_server/lib/src/analysis_manager.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) 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 analysis.logger; 5 library analysis.logger;
6 6
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/java_engine.dart'; 8 import 'package:analyzer/src/generated/java_engine.dart';
9 import 'package:logging/logging.dart' as logging; 9 import 'package:logging/logging.dart' as logging;
10 10
11 /** 11 /**
12 * Instances of the class [AnalysisLogger] translate from the analysis engine's 12 * Instances of the class [AnalysisLogger] translate from the analysis engine's
13 * API to the logging package's API. 13 * API to the logging package's API.
14 */ 14 */
15 class AnalysisLogger implements Logger { 15 class AnalysisLogger implements Logger {
16 /** 16 /**
17 * The underlying logger that is being wrapped. 17 * The underlying logger that is being wrapped.
18 */ 18 */
19 final logging.Logger baseLogger = new logging.Logger('analysis.server'); 19 final logging.Logger baseLogger = new logging.Logger('analysis.server');
20 20
21 AnalysisLogger() { 21 AnalysisLogger() {
22 logging.Logger.root.onRecord.listen((logging.LogRecord record) { 22 logging.Logger.root.onRecord.listen((logging.LogRecord record) {
23 AnalysisEngine.instance.instrumentationService.logLogEntry( 23 AnalysisEngine.instance.instrumentationService.logLogEntry(
24 record.level.name, 24 record.level.name, record.time, record.message);
25 record.time,
26 record.message);
27 }); 25 });
28 } 26 }
29 27
30 @override 28 @override
31 void logError(String message, [CaughtException exception]) { 29 void logError(String message, [CaughtException exception]) {
32 if (exception == null) { 30 if (exception == null) {
33 baseLogger.severe(message); 31 baseLogger.severe(message);
34 } else { 32 } else {
35 baseLogger.severe(message, exception.exception, exception.stackTrace); 33 baseLogger.severe(message, exception.exception, exception.stackTrace);
36 } 34 }
(...skipping 11 matching lines...) Expand all
48 } else { 46 } else {
49 baseLogger.info(message, exception.exception, exception.stackTrace); 47 baseLogger.info(message, exception.exception, exception.stackTrace);
50 } 48 }
51 } 49 }
52 50
53 @override 51 @override
54 void logInformation2(String message, Object exception) { 52 void logInformation2(String message, Object exception) {
55 baseLogger.info(message, exception); 53 baseLogger.info(message, exception);
56 } 54 }
57 } 55 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698