Unverified Commit 22ca3f96 authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tool] Don't truncate verbose logs from _flutter.listViews (#34255)

parent 75b5cecc
......@@ -843,12 +843,15 @@ class VM extends ServiceObjectOwner {
Future<Map<String, dynamic>> invokeRpcRaw(
String method, {
Map<String, dynamic> params = const <String, dynamic>{},
bool truncateLogs = true,
}) async {
printTrace('Sending to VM service: $method($params)');
assert(params != null);
try {
final Map<String, dynamic> result = await _vmService._sendRequest(method, params);
printTrace('Result: ${_truncate(result.toString(), 250, '...')}');
final String resultString =
truncateLogs ? _truncate(result.toString(), 250, '...') : result.toString();
printTrace('Result: $resultString');
return result;
} on WebSocketChannelException catch (error) {
throwToolExit('Error connecting to observatory: $error');
......@@ -864,10 +867,12 @@ class VM extends ServiceObjectOwner {
Future<T> invokeRpc<T extends ServiceObject>(
String method, {
Map<String, dynamic> params = const <String, dynamic>{},
bool truncateLogs = true,
}) async {
final Map<String, dynamic> response = await invokeRpcRaw(
method,
params: params,
truncateLogs: truncateLogs,
);
final ServiceObject serviceObject = ServiceObject._fromMap(this, response);
if ((serviceObject != null) && (serviceObject._canCache)) {
......@@ -971,7 +976,8 @@ class VM extends ServiceObjectOwner {
// When the future returned by invokeRpc() below returns,
// the _viewCache will have been updated.
// This message updates all the views of every isolate.
await vmService.vm.invokeRpc<ServiceObject>('_flutter.listViews');
await vmService.vm.invokeRpc<ServiceObject>(
'_flutter.listViews', truncateLogs: false);
if (_viewCache.values.isNotEmpty || !waitForViews)
return;
failCount += 1;
......
......@@ -250,6 +250,7 @@ class MockVM implements VM {
Map<String, dynamic> params = const <String, dynamic>{},
Duration timeout,
bool timeoutFatal = true,
bool truncateLogs = true,
}) async {
_service.messages.add('$method $params');
return <String, dynamic>{'success': true};
......
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