Unverified Commit bd6ac326 authored by Andrew Davies's avatar Andrew Davies Committed by GitHub

[flutter_driver] Move Fuchsia logging code. (#26266)

When setting the Fuchsia logging function, it should happen before any
initialization code, as init can still cause warning/error/info messages
to get printed to logs. Since the default stderr/stdout fd's aren't
correct, this can cause a program to crash for unclear reasons.
parent 75ebce1c
......@@ -199,6 +199,9 @@ class FlutterDriver {
// If the user has already supplied an isolate number/URL to the Dart VM
// service, then this won't be run as it is unnecessary.
if (Platform.isFuchsia && isolateNumber == null) {
// TODO(awdavies): Use something other than print. On fuchsia
// `stderr`/`stdout` appear to have issues working correctly.
flutterDriverLog.listen(print);
fuchsiaModuleTarget ??= Platform.environment['FUCHSIA_MODULE_TARGET'];
if (fuchsiaModuleTarget == null) {
throw DriverError('No Fuchsia module target has been specified.\n'
......@@ -215,10 +218,6 @@ class FlutterDriver {
dartVmServiceUrl = ref.dartVm.uri.toString();
await fuchsiaConnection.stop();
FuchsiaCompat.cleanup();
// TODO(awdavies): Use something other than print. On fuchsia
// `stderr`/`stdout` appear to have issues working correctly.
flutterDriverLog.listen(print);
}
dartVmServiceUrl ??= Platform.environment['VM_SERVICE_URL'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment