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
17b9c12b
Commit
17b9c12b
authored
May 23, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust adb logcat filter (#4104)
parent
40179aaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+33
-7
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
17b9c12b
...
...
@@ -522,6 +522,8 @@ class _AdbLogReader extends DeviceLogReader {
final
AndroidDevice
device
;
bool
_lastWasFiltered
=
false
;
StreamController
<
String
>
_linesController
;
Process
_process
;
...
...
@@ -537,9 +539,6 @@ class _AdbLogReader extends DeviceLogReader {
String
lastTimestamp
=
device
.
lastLogcatTimestamp
;
if
(
lastTimestamp
!=
null
)
args
.
addAll
(<
String
>[
'-T'
,
lastTimestamp
]);
args
.
addAll
(<
String
>[
'-s'
,
'flutter:V'
,
'FlutterMain:V'
,
'FlutterView:V'
,
'AndroidRuntime:W'
,
'ActivityManager:W'
,
'System.err:W'
,
'*:F'
]);
runCommand
(
device
.
adbCommandForDevice
(
args
)).
then
((
Process
process
)
{
_process
=
process
;
_process
.
stdout
.
transform
(
UTF8
.
decoder
).
transform
(
const
LineSplitter
()).
listen
(
_onLine
);
...
...
@@ -552,11 +551,38 @@ class _AdbLogReader extends DeviceLogReader {
});
}
// 'W/ActivityManager: '
static
final
RegExp
_logFormat
=
new
RegExp
(
r'^[VDIWEF]\/[^:]+:\s+'
);
static
final
List
<
RegExp
>
_whitelistedTags
=
<
RegExp
>[
new
RegExp
(
r'^[VDIWEF]\/flutter[^:]*:\s+'
,
caseSensitive:
false
),
new
RegExp
(
r'^[WEF]\/AndroidRuntime:\s+'
),
new
RegExp
(
r'^[WEF]\/ActivityManager:\s+'
),
new
RegExp
(
r'^[WEF]\/System\.err:\s+'
),
new
RegExp
(
r'^[F]\/[\S^:]+:\s+'
)
];
void
_onLine
(
String
line
)
{
// Filter out some noisy ActivityManager notifications.
if
(
line
.
startsWith
(
'W/ActivityManager: getRunningAppProcesses'
))
return
;
_linesController
.
add
(
line
);
if
(
_logFormat
.
hasMatch
(
line
))
{
// Filter out some noisy ActivityManager notifications.
if
(
line
.
startsWith
(
'W/ActivityManager: getRunningAppProcesses'
))
return
;
// Filter on approved names and levels.
for
(
RegExp
regex
in
_whitelistedTags
)
{
if
(
regex
.
hasMatch
(
line
))
{
_lastWasFiltered
=
false
;
_linesController
.
add
(
line
);
return
;
}
}
_lastWasFiltered
=
true
;
}
else
{
// If it doesn't match the log pattern at all, pass it through.
if
(!
_lastWasFiltered
)
_linesController
.
add
(
line
);
}
}
void
_stop
()
{
...
...
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