Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7e942b62
Unverified
Commit
7e942b62
authored
Jun 03, 2020
by
Jonah Williams
Committed by
GitHub
Jun 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] iOS VM Service logs should include stderr (#58551)
parent
e72e7f9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
7 deletions
+33
-7
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+12
-3
ios_device_logger_test.dart
..._tools/test/general.shard/ios/ios_device_logger_test.dart
+21
-4
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
7e942b62
...
...
@@ -655,16 +655,25 @@ class IOSDeviceLogReader extends DeviceLogReader {
return
;
}
try
{
await
connectedVmService
.
streamListen
(
'Stdout'
);
await
Future
.
wait
(<
Future
<
void
>>[
connectedVmService
.
streamListen
(
vm_service
.
EventStreams
.
kStdout
),
connectedVmService
.
streamListen
(
vm_service
.
EventStreams
.
kStderr
),
]);
}
on
vm_service
.
RPCError
{
// Do nothing, since the tool is already subscribed.
}
_loggingSubscriptions
.
add
(
connectedVmService
.
onStdoutEvent
.
listen
((
vm_service
.
Event
event
)
{
void
logMessage
(
vm_service
.
Event
event
)
{
final
String
message
=
utf8
.
decode
(
base64
.
decode
(
event
.
bytes
));
if
(
message
.
isNotEmpty
)
{
_linesController
.
add
(
message
);
}
}));
}
_loggingSubscriptions
.
addAll
(<
StreamSubscription
<
void
>>[
connectedVmService
.
onStdoutEvent
.
listen
(
logMessage
),
connectedVmService
.
onStderrEvent
.
listen
(
logMessage
),
]);
}
void
_listenToSysLog
()
{
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_logger_test.dart
View file @
7e942b62
...
...
@@ -153,25 +153,42 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt
logger:
logger
,
),
);
final
StreamController
<
Event
>
controller
=
StreamController
<
Event
>();
final
StreamController
<
Event
>
stdoutController
=
StreamController
<
Event
>();
final
StreamController
<
Event
>
stderController
=
StreamController
<
Event
>();
final
Completer
<
Success
>
stdoutCompleter
=
Completer
<
Success
>();
final
Completer
<
Success
>
stderrCompleter
=
Completer
<
Success
>();
when
(
vmService
.
streamListen
(
'Stdout'
)).
thenAnswer
((
Invocation
invocation
)
{
return
stdoutCompleter
.
future
;
});
when
(
vmService
.
streamListen
(
'Stderr'
)).
thenAnswer
((
Invocation
invocation
)
{
return
stderrCompleter
.
future
;
});
when
(
vmService
.
onStdoutEvent
).
thenAnswer
((
Invocation
invocation
)
{
return
controller
.
stream
;
return
stdoutController
.
stream
;
});
when
(
vmService
.
onStderrEvent
).
thenAnswer
((
Invocation
invocation
)
{
return
stderController
.
stream
;
});
logReader
.
connectedVMService
=
vmService
;
stdoutCompleter
.
complete
(
Success
());
controller
.
add
(
Event
(
stderrCompleter
.
complete
(
Success
());
stdoutController
.
add
(
Event
(
kind:
'Stdout'
,
timestamp:
0
,
bytes:
base64
.
encode
(
utf8
.
encode
(
' This is a message '
)),
));
stderController
.
add
(
Event
(
kind:
'Stderr'
,
timestamp:
0
,
bytes:
base64
.
encode
(
utf8
.
encode
(
' And this is an error '
)),
));
// Wait for stream listeners to fire.
await
expectLater
(
logReader
.
logLines
,
emits
(
' This is a message '
));
await
expectLater
(
logReader
.
logLines
,
emitsInAnyOrder
(<
Matcher
>[
equals
(
' This is a message '
),
equals
(
' And this is an error '
),
]));
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment