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

Unified Diff: pkg/analyzer/lib/instrumentation/file_instrumentation.dart

Issue 2717253002: Add instrumentation data to the analysis server diagnostics page. (Closed)
Patch Set: refactor String get describe Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/instrumentation/file_instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/file_instrumentation.dart b/pkg/analyzer/lib/instrumentation/file_instrumentation.dart
index d4088f87fd145cb493c5b0103c0462f3c53fdc1e..32133f6505c5cff5eae17db339d76f9b31b65cbf 100644
--- a/pkg/analyzer/lib/instrumentation/file_instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/file_instrumentation.dart
@@ -13,10 +13,11 @@ import 'package:analyzer/instrumentation/instrumentation.dart';
* An [InstrumentationServer] that writes to a file.
*/
class FileInstrumentationServer implements InstrumentationServer {
+ final String filePath;
IOSink _sink;
- FileInstrumentationServer(String path) {
- File file = new File(path);
+ FileInstrumentationServer(this.filePath) {
+ File file = new File(filePath);
_sink = file.openWrite();
}
@@ -24,6 +25,9 @@ class FileInstrumentationServer implements InstrumentationServer {
String get sessionId => '';
@override
+ String get describe => "file: $filePath";
skybrian 2017/03/01 02:06:01 HTML-escape the path (just in case).
Brian Wilkerson 2017/03/01 15:05:02 Safer to escape the result of describe in the GetH
+
+ @override
void log(String message) {
_sink.writeln(message);
}

Powered by Google App Engine
This is Rietveld 408576698