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
67b3871e
Commit
67b3871e
authored
Apr 07, 2017
by
Jason Simmons
Committed by
GitHub
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter Android logs by the pid of the remote process (#9293)
Fixes
https://github.com/flutter/flutter/issues/6849
parent
8bcf302e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
10 deletions
+27
-10
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+15
-10
device.dart
packages/flutter_tools/lib/src/device.dart
+3
-0
run_cold.dart
packages/flutter_tools/lib/src/run_cold.dart
+1
-0
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+2
-0
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+6
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
67b3871e
...
...
@@ -621,8 +621,8 @@ class _AdbLogReader extends DeviceLogReader {
});
}
// 'W/ActivityManager: '
static
final
RegExp
_logFormat
=
new
RegExp
(
r'^[VDIWEF]\/.
{8,}
:\s'
);
// 'W/ActivityManager
(pid)
: '
static
final
RegExp
_logFormat
=
new
RegExp
(
r'^[VDIWEF]\/.
*?\(\s*(\d+)\)
:\s'
);
static
final
List
<
RegExp
>
_whitelistedTags
=
<
RegExp
>[
new
RegExp
(
r'^[VDIWEF]\/flutter[^:]*:\s+'
,
caseSensitive:
false
),
...
...
@@ -657,14 +657,19 @@ class _AdbLogReader extends DeviceLogReader {
}
// Chop off the time.
line
=
line
.
substring
(
timeMatch
.
end
+
1
);
if
(
_logFormat
.
hasMatch
(
line
))
{
// Filter on approved names and levels.
for
(
RegExp
regex
in
_whitelistedTags
)
{
if
(
regex
.
hasMatch
(
line
))
{
_acceptedLastLine
=
true
;
_linesController
.
add
(
line
);
return
;
}
final
Match
logMatch
=
_logFormat
.
firstMatch
(
line
);
if
(
logMatch
!=
null
)
{
bool
acceptLine
=
false
;
if
(
appPid
!=
null
&&
int
.
parse
(
logMatch
.
group
(
1
))
==
appPid
)
{
acceptLine
=
true
;
}
else
{
// Filter on approved names and levels.
acceptLine
=
_whitelistedTags
.
any
((
RegExp
re
)
=>
re
.
hasMatch
(
line
));
}
if
(
acceptLine
)
{
_acceptedLastLine
=
true
;
_linesController
.
add
(
line
);
return
;
}
_acceptedLastLine
=
false
;
}
else
if
(
line
==
'--------- beginning of system'
||
...
...
packages/flutter_tools/lib/src/device.dart
View file @
67b3871e
...
...
@@ -374,6 +374,9 @@ abstract class DeviceLogReader {
@override
String
toString
()
=>
name
;
/// Process ID of the app on the deivce.
int
appPid
;
}
/// Describes an app running on the device.
...
...
packages/flutter_tools/lib/src/run_cold.dart
View file @
67b3871e
...
...
@@ -114,6 +114,7 @@ class ColdRunner extends ResidentRunner {
printTrace
(
'Application running.'
);
if
(
vmService
!=
null
)
{
device
.
getLogReader
(
app:
package
).
appPid
=
vmService
.
vm
.
pid
;
await
vmService
.
vm
.
refreshViews
();
printTrace
(
'Connected to
${vmService.vm.firstView}
\
.'
);
}
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
67b3871e
...
...
@@ -101,6 +101,8 @@ class HotRunner extends ResidentRunner {
return
2
;
}
device
.
getLogReader
(
app:
package
).
appPid
=
vmService
.
vm
.
pid
;
try
{
final
Uri
baseUri
=
await
_initDevFS
();
if
(
connectionInfoCompleter
!=
null
)
{
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
67b3871e
...
...
@@ -507,6 +507,7 @@ class VM extends ServiceObjectOwner {
_loaded
=
true
;
// TODO(johnmccutchan): Extract any properties we care about here.
_pid
=
map
[
'pid'
];
// Remove any isolates which are now dead from the isolate cache.
_removeDeadIsolates
(
map
[
'isolates'
]);
...
...
@@ -521,6 +522,11 @@ class VM extends ServiceObjectOwner {
/// The set of live views.
final
Map
<
String
,
FlutterView
>
_viewCache
=
<
String
,
FlutterView
>{};
/// The pid of the VM's process.
int
_pid
;
int
get
pid
=>
_pid
;
int
_compareIsolates
(
Isolate
a
,
Isolate
b
)
{
final
DateTime
aStart
=
a
.
startTime
;
final
DateTime
bStart
=
b
.
startTime
;
...
...
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