Unverified Commit 658e6c8a authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Listen to Debug VM stream to get Stdout logs from VMService (#66310)

parent 8e8acaac
...@@ -10,6 +10,7 @@ import 'package:process/process.dart'; ...@@ -10,6 +10,7 @@ import 'package:process/process.dart';
import 'package:vm_service/vm_service.dart' as vm_service; import 'package:vm_service/vm_service.dart' as vm_service;
import '../application_package.dart'; import '../application_package.dart';
import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart'; import '../base/io.dart';
import '../base/logger.dart'; import '../base/logger.dart';
...@@ -678,6 +679,10 @@ class IOSDeviceLogReader extends DeviceLogReader { ...@@ -678,6 +679,10 @@ class IOSDeviceLogReader extends DeviceLogReader {
return; return;
} }
try { try {
// The VM service will not publish logging events unless the debug stream is being listened to.
// Listen to this stream as a side effect.
unawaited(connectedVmService.streamListen('Debug'));
await Future.wait(<Future<void>>[ await Future.wait(<Future<void>>[
connectedVmService.streamListen(vm_service.EventStreams.kStdout), connectedVmService.streamListen(vm_service.EventStreams.kStdout),
connectedVmService.streamListen(vm_service.EventStreams.kStderr), connectedVmService.streamListen(vm_service.EventStreams.kStderr),
......
...@@ -189,6 +189,7 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt ...@@ -189,6 +189,7 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt
equals(' This is a message '), equals(' This is a message '),
equals(' And this is an error '), equals(' And this is an error '),
])); ]));
verify(vmService.streamListen('Debug'));
}); });
} }
......
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