Improve verbose trace output (#9104)
Related #8876
diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart
index 20cba46..c88cf9c 100644
--- a/packages/flutter_tools/lib/src/devfs.dart
+++ b/packages/flutter_tools/lib/src/devfs.dart
@@ -339,14 +339,16 @@
Uri get baseUri => _baseUri;
Future<Uri> create() async {
+ printTrace('DevFS: Creating new filesystem on the device ($_baseUri)');
_baseUri = await _operations.create(fsName);
printTrace('DevFS: Created new filesystem on the device ($_baseUri)');
return _baseUri;
}
- Future<dynamic> destroy() {
+ Future<Null> destroy() async {
+ printTrace('DevFS: Deleting filesystem on the device ($_baseUri)');
+ await _operations.destroy(fsName);
printTrace('DevFS: Deleted filesystem on the device ($_baseUri)');
- return _operations.destroy(fsName);
}
/// Update files on the device and return the number of bytes sync'd
diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart
index 0a88e13..f7188f9 100644
--- a/packages/flutter_tools/lib/src/resident_runner.dart
+++ b/packages/flutter_tools/lib/src/resident_runner.dart
@@ -226,7 +226,19 @@
throwToolExit('No Flutter view is available');
// Listen for service protocol connection to close.
- vmService.done.whenComplete(appFinished);
+ vmService.done.then<Null>(
+ _serviceProtocolDone,
+ onError: _serviceProtocolError).whenComplete(appFinished);
+ }
+
+ Future<Null> _serviceProtocolDone(dynamic object) {
+ printTrace('Service protocol connection closed.');
+ return new Future<Null>.value(object);
+ }
+
+ Future<Null> _serviceProtocolError(dynamic error, StackTrace stack) {
+ printTrace('Service protocol connection closed with an error: $error\n$stack');
+ return new Future<Null>.error(error, stack);
}
/// Returns [true] if the input has been handled by this function.