| 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 instrumentation; | 5 library instrumentation; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/task/model.dart'; | 9 import 'package:analyzer/task/model.dart'; |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 _instrumentationServer | 143 _instrumentationServer |
| 144 .log(_join([TAG_FILE_READ, path, timeStamp, content])); | 144 .log(_join([TAG_FILE_READ, path, timeStamp, content])); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * Log that a log entry that was written to the analysis engine's log. The log | 149 * Log that a log entry that was written to the analysis engine's log. The log |
| 150 * entry has the given [level] and [message], and was created at the given | 150 * entry has the given [level] and [message], and was created at the given |
| 151 * [time]. | 151 * [time]. |
| 152 */ | 152 */ |
| 153 void logLogEntry(String level, DateTime time, String message, Object exception
, StackTrace stackTrace) { | 153 void logLogEntry(String level, DateTime time, String message, |
| 154 Object exception, StackTrace stackTrace) { |
| 154 if (_instrumentationServer != null) { | 155 if (_instrumentationServer != null) { |
| 155 String timeStamp = | 156 String timeStamp = |
| 156 time == null ? 'null' : time.millisecondsSinceEpoch.toString(); | 157 time == null ? 'null' : time.millisecondsSinceEpoch.toString(); |
| 157 String exceptionText = exception.toString(); | 158 String exceptionText = exception.toString(); |
| 158 String stackTraceText = stackTrace.toString(); | 159 String stackTraceText = stackTrace.toString(); |
| 159 _instrumentationServer | 160 _instrumentationServer.log(_join([ |
| 160 .log(_join([TAG_LOG_ENTRY, level, timeStamp, message, exceptionText, s
tackTraceText])); | 161 TAG_LOG_ENTRY, |
| 162 level, |
| 163 timeStamp, |
| 164 message, |
| 165 exceptionText, |
| 166 stackTraceText |
| 167 ])); |
| 161 } | 168 } |
| 162 } | 169 } |
| 163 | 170 |
| 164 /** | 171 /** |
| 165 * Log that a notification has been sent to the client. | 172 * Log that a notification has been sent to the client. |
| 166 */ | 173 */ |
| 167 void logNotification(String notification) { | 174 void logNotification(String notification) { |
| 168 _log(TAG_NOTIFICATION, notification); | 175 _log(TAG_NOTIFICATION, notification); |
| 169 } | 176 } |
| 170 | 177 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 372 } |
| 366 } | 373 } |
| 367 | 374 |
| 368 @override | 375 @override |
| 369 void shutdown() { | 376 void shutdown() { |
| 370 for (InstrumentationServer server in _servers) { | 377 for (InstrumentationServer server in _servers) { |
| 371 server.shutdown(); | 378 server.shutdown(); |
| 372 } | 379 } |
| 373 } | 380 } |
| 374 } | 381 } |
| OLD | NEW |