mirror of
https://github.com/flutter/flutter.git
synced 2026-02-13 06:13:10 +08:00
Listen to Debug VM stream to get Stdout logs from VMService (#66310)
This commit is contained in:
parent
8e8acaac7a
commit
658e6c8a8d
@ -10,6 +10,7 @@ import 'package:process/process.dart';
|
||||
import 'package:vm_service/vm_service.dart' as vm_service;
|
||||
|
||||
import '../application_package.dart';
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/io.dart';
|
||||
import '../base/logger.dart';
|
||||
@ -678,6 +679,10 @@ class IOSDeviceLogReader extends DeviceLogReader {
|
||||
return;
|
||||
}
|
||||
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>>[
|
||||
connectedVmService.streamListen(vm_service.EventStreams.kStdout),
|
||||
connectedVmService.streamListen(vm_service.EventStreams.kStderr),
|
||||
|
||||
@ -189,6 +189,7 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt
|
||||
equals(' This is a message '),
|
||||
equals(' And this is an error '),
|
||||
]));
|
||||
verify(vmService.streamListen('Debug'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user