| 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 analyzer.instrumentation.instrumentation; | 5 library analyzer.instrumentation.instrumentation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/task/model.dart'; | 10 import 'package:analyzer/task/model.dart'; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 * The current time, expressed as a decimal encoded number of milliseconds. | 99 * The current time, expressed as a decimal encoded number of milliseconds. |
| 100 */ | 100 */ |
| 101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); | 101 String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * Log that the given analysis [task] is being performed in the given | 104 * Log that the given analysis [task] is being performed in the given |
| 105 * [context]. | 105 * [context]. |
| 106 */ | 106 */ |
| 107 void logAnalysisTask(String context, AnalysisTask task) { | 107 void logAnalysisTask(String context, AnalysisTask task) { |
| 108 if (_instrumentationServer != null) { | 108 if (_instrumentationServer != null) { |
| 109 String description = | |
| 110 (task is AnalysisTask) ? task.description : task.toString(); | |
| 111 _instrumentationServer | 109 _instrumentationServer |
| 112 .log(_join([TAG_ANALYSIS_TASK, context, description])); | 110 .log(_join([TAG_ANALYSIS_TASK, context, task.description])); |
| 113 } | 111 } |
| 114 } | 112 } |
| 115 | 113 |
| 116 /** | 114 /** |
| 117 * Log the fact that an error, described by the given [message], has occurred. | 115 * Log the fact that an error, described by the given [message], has occurred. |
| 118 */ | 116 */ |
| 119 void logError(String message) { | 117 void logError(String message) { |
| 120 _log(TAG_ERROR, message); | 118 _log(TAG_ERROR, message); |
| 121 } | 119 } |
| 122 | 120 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 369 } |
| 372 } | 370 } |
| 373 | 371 |
| 374 @override | 372 @override |
| 375 Future shutdown() async { | 373 Future shutdown() async { |
| 376 for (InstrumentationServer server in _servers) { | 374 for (InstrumentationServer server in _servers) { |
| 377 await server.shutdown(); | 375 await server.shutdown(); |
| 378 } | 376 } |
| 379 } | 377 } |
| 380 } | 378 } |
| OLD | NEW |