File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
analysis_server/lib/src/lsp/handlers
analyzer/lib/instrumentation Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ class InitializingStateMessageHandler extends ServerStateMessageHandler {
122122 ErrorOr <void > handleUnknownMessage (IncomingMessage message) {
123123 // Silently drop non-requests.
124124 if (message is ! RequestMessage ) {
125+ server.instrumentationService
126+ .logInfo ('Ignoring ${message .method } message while initializing' );
125127 return success ();
126128 }
127129 return error (
@@ -142,6 +144,8 @@ class UninitializedStateMessageHandler extends ServerStateMessageHandler {
142144 FutureOr <ErrorOr <Object >> handleUnknownMessage (IncomingMessage message) {
143145 // Silently drop non-requests.
144146 if (message is ! RequestMessage ) {
147+ server.instrumentationService
148+ .logInfo ('Ignoring ${message .method } message while uninitialized' );
145149 return success ();
146150 }
147151 return error (ErrorCodes .ServerNotInitialized ,
@@ -159,6 +163,8 @@ class ShuttingDownStateMessageHandler extends ServerStateMessageHandler {
159163 FutureOr <ErrorOr <Object >> handleUnknownMessage (IncomingMessage message) {
160164 // Silently drop non-requests.
161165 if (message is ! RequestMessage ) {
166+ server.instrumentationService
167+ .logInfo ('Ignoring ${message .method } message while shutting down' );
162168 return success ();
163169 }
164170 return error (ErrorCodes .InvalidRequest ,
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ class InstrumentationService {
7070 static const String TAG_ERROR = 'Err' ;
7171 static const String TAG_EXCEPTION = 'Ex' ;
7272 static const String TAG_FILE_READ = 'Read' ;
73+ static const String TAG_INFO = 'Info' ;
7374 static const String TAG_LOG_ENTRY = 'Log' ;
7475 static const String TAG_NOTIFICATION = 'Noti' ;
7576 static const String TAG_PERFORMANCE = 'Perf' ;
@@ -163,6 +164,11 @@ class InstrumentationService {
163164 }
164165 }
165166
167+ /**
168+ * Log unstructured text information for debugging purposes.
169+ */
170+ void logInfo (String message) => _log (TAG_INFO , message);
171+
166172 /**
167173 * Log that a log entry that was written to the analysis engine's log. The log
168174 * entry has the given [level] and [message] , and was created at the given
You can’t perform that action at this time.
0 commit comments