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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2543713002: Add a new Analysis Server option '--new-analysis-driver-log'. (Closed)
Patch Set: Created 4 years 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/lib/src/server/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index e179dda68dba22c4cccf47ae47b14e3083ede318..c16ed6ba98cebcac5e3e576f2d7887ab8a1c1674 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -366,7 +366,20 @@ class AnalysisServer {
options.finerGrainedInvalidation;
defaultContextOptions.generateImplicitErrors = false;
operationQueue = new ServerOperationQueue();
- _analysisPerformanceLogger = new nd.PerformanceLog(io.stdout);
+
+ {
+ String name = options.newAnalysisDriverLog;
+ StringSink sink = new _NullStringSink();
+ if (name != null) {
+ if (name == 'stdout') {
+ sink = io.stdout;
+ } else if (name.startsWith('file:')) {
+ String path = name.substring('file:'.length);
+ sink = new io.File(path).openWrite(mode: io.FileMode.APPEND);
+ }
+ }
+ _analysisPerformanceLogger = new nd.PerformanceLog(sink);
+ }
if (resourceProvider is PhysicalResourceProvider) {
byteStore = new MemoryCachingByteStore(
new FileByteStore(
@@ -380,6 +393,7 @@ class AnalysisServer {
new nd.AnalysisDriverScheduler(_analysisPerformanceLogger);
analysisDriverScheduler.status.listen(sendStatusNotificationNew);
analysisDriverScheduler.start();
+
if (useSingleContextManager) {
contextManager = new SingleContextManager(resourceProvider, sdkManager,
packageResolverProvider, analyzedFilesGlobs, defaultContextOptions);
@@ -1732,6 +1746,7 @@ class AnalysisServerOptions {
bool noIndex = false;
bool useAnalysisHighlight2 = false;
String fileReadMode = 'as-is';
+ String newAnalysisDriverLog;
}
/**
@@ -2068,3 +2083,10 @@ class ServerPerformanceStatistics {
*/
static PerformanceTag splitStore = new PerformanceTag('splitStore');
}
+
+class _NullStringSink implements StringSink {
+ void write(Object obj) {}
+ void writeAll(Iterable objects, [String separator = ""]) {}
+ void writeCharCode(int charCode) {}
+ void writeln([Object obj = ""]) {}
+}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698