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) { | 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 _instrumentationServer | 158 String exceptionText = exception.toString(); |
158 .log(_join([TAG_LOG_ENTRY, level, timeStamp, message])); | 159 String stackTraceText = stackTrace.toString(); |
| 160 _instrumentationServer.log(_join([ |
| 161 TAG_LOG_ENTRY, |
| 162 level, |
| 163 timeStamp, |
| 164 message, |
| 165 exceptionText, |
| 166 stackTraceText |
| 167 ])); |
159 } | 168 } |
160 } | 169 } |
161 | 170 |
162 /** | 171 /** |
163 * Log that a notification has been sent to the client. | 172 * Log that a notification has been sent to the client. |
164 */ | 173 */ |
165 void logNotification(String notification) { | 174 void logNotification(String notification) { |
166 _log(TAG_NOTIFICATION, notification); | 175 _log(TAG_NOTIFICATION, notification); |
167 } | 176 } |
168 | 177 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 372 } |
364 } | 373 } |
365 | 374 |
366 @override | 375 @override |
367 void shutdown() { | 376 void shutdown() { |
368 for (InstrumentationServer server in _servers) { | 377 for (InstrumentationServer server in _servers) { |
369 server.shutdown(); | 378 server.shutdown(); |
370 } | 379 } |
371 } | 380 } |
372 } | 381 } |
OLD | NEW |