Index: pkg/analyzer/lib/instrumentation/instrumentation.dart |
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart |
index 0cf572433fcbb8735a12ec4545c40d353e83e477..4a44db4c27cdfad6f3d4a8a3e6ef5dc6fc18671e 100644 |
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart |
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart |
@@ -53,6 +53,7 @@ class InstrumentationService { |
static final InstrumentationService NULL_SERVICE = |
new InstrumentationService(null); |
+ static const String TAG_ANALYSIS_TASK = 'Task'; |
static const String TAG_ERROR = 'Err'; |
static const String TAG_EXCEPTION = 'Ex'; |
static const String TAG_FILE_READ = 'Read'; |
@@ -62,6 +63,7 @@ class InstrumentationService { |
static const String TAG_REQUEST = 'Req'; |
static const String TAG_RESPONSE = 'Res'; |
static const String TAG_VERSION = 'Ver'; |
+ static const String TAG_WATCH_EVENT = 'Watch'; |
/** |
* The instrumentation server used to communicate with the server, or `null` |
@@ -87,6 +89,17 @@ class InstrumentationService { |
String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString(); |
/** |
+ * Log that an analysis task is being performed in the given [context]. The |
+ * task has the given [description]. |
+ */ |
+ void logAnalysisTask(String context, String description) { |
+ if (_instrumentationServer != null) { |
+ _instrumentationServer.log( |
+ _join([TAG_ANALYSIS_TASK, context, description])); |
+ } |
+ } |
+ |
+ /** |
* Log the fact that an error, described by the given [message], has occurred. |
*/ |
void logError(String message) { |
@@ -201,6 +214,19 @@ class InstrumentationService { |
} |
/** |
+ * Log that the file system watcher sent an event. The [folderPath] is the |
+ * path to the folder containing the changed file, the [filePath] is the path |
+ * of the file that changed, and the [changeType] indicates what kind of |
+ * change occurred. |
+ */ |
+ void logWatchEvent(String folderPath, String filePath, String changeType) { |
+ if (_instrumentationServer != null) { |
+ _instrumentationServer.log( |
+ _join([TAG_WATCH_EVENT, folderPath, filePath, changeType])); |
+ } |
+ } |
+ |
+ /** |
* Signal that the client is done communicating with the instrumentation |
* server. This method should be invoked exactly one time and no other methods |
* should be invoked on this instance after this method has been invoked. |