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

Unified Diff: pkg/analysis_server/tool/instrumentation/log/log.dart

Issue 2466403002: Fix bugs in the log viewer (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analysis_server/tool/instrumentation/page/log_page.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/instrumentation/log/log.dart
diff --git a/pkg/analysis_server/tool/instrumentation/log/log.dart b/pkg/analysis_server/tool/instrumentation/log/log.dart
index 2378c27a33454801dad5055e845af436dd99272e..37bb4f514eb1dfbad68fe37c852301808093ef7e 100644
--- a/pkg/analysis_server/tool/instrumentation/log/log.dart
+++ b/pkg/analysis_server/tool/instrumentation/log/log.dart
@@ -8,6 +8,7 @@
library analysis_server.tool.instrumentation.log.log;
import 'dart:convert';
+import 'dart:math' as math;
import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -304,14 +305,21 @@ class InstrumentationLog {
if (extraLines.isNotEmpty) {
logContent[i] = merge(line, extraLines);
}
+ extraLines.clear();
} else {
logContent.removeAt(i);
extraLines.insert(0, line);
}
}
if (extraLines.isNotEmpty) {
- throw new StateError(
- '${extraLines.length} non-entry lines before any entry');
+ int count = math.min(extraLines.length, 10);
+ StringBuffer buffer = new StringBuffer();
+ buffer.writeln('${extraLines.length} non-entry lines before any entry');
+ buffer.writeln('First $count lines:');
+ for (int i = 0; i < count; i++) {
+ buffer.writeln(extraLines[i]);
+ }
+ throw new StateError(buffer.toString());
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/tool/instrumentation/page/log_page.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698