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
ad7fd3e4
Commit
ad7fd3e4
authored
Mar 09, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2527 from devoncarew/fix_logs
fix a regression in flutter logs
parents
335354d9
2e9fef8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
18 deletions
+8
-18
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+6
-16
logs.dart
packages/flutter_tools/lib/src/commands/logs.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
ad7fd3e4
...
...
@@ -102,7 +102,7 @@ class AndroidDevice extends Device {
// output lines like this, which we want to ignore:
// adb server is out of date. killing..
// * daemon started successfully *
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'start-server'
])
);
runCheckedSync
(
<
String
>[
androidSdk
.
adbPath
,
'start-server'
]
);
// Sample output: '22'
String
sdkVersion
=
runCheckedSync
(
...
...
@@ -283,7 +283,7 @@ class AndroidDevice extends Device {
TargetPlatform
get
platform
=>
TargetPlatform
.
android
;
void
clearLogs
()
{
runSync
(
adbCommandForDevice
(<
String
>[
'
-s'
,
id
,
'
logcat'
,
'-c'
]));
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
}
DeviceLogReader
get
logReader
{
...
...
@@ -306,7 +306,7 @@ class AndroidDevice extends Device {
/// no available timestamp. The format can be passed to logcat's -T option.
String
get
lastLogcatTimestamp
{
String
output
=
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'
-s'
,
id
,
'
logcat'
,
'-v'
,
'time'
,
'-t'
,
'1'
'logcat'
,
'-v'
,
'time'
,
'-t'
,
'1'
]));
RegExp
timeRegExp
=
new
RegExp
(
r'^\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}'
,
multiLine:
true
);
...
...
@@ -332,7 +332,7 @@ class AndroidDevice extends Device {
String
tracePath
=
null
;
bool
isComplete
=
false
;
while
(!
isComplete
)
{
List
<
String
>
args
=
<
String
>[
'
-s'
,
id
,
'
logcat'
,
'-d'
];
List
<
String
>
args
=
<
String
>[
'logcat'
,
'-d'
];
if
(
beforeStop
!=
null
)
args
.
addAll
(<
String
>[
'-T'
,
beforeStop
]);
String
logs
=
runCheckedSync
(
adbCommandForDevice
(
args
));
...
...
@@ -488,21 +488,11 @@ class _AdbLogReader extends DeviceLogReader {
throw
new
StateError
(
'_AdbLogReader must be stopped before it can be started.'
);
// Start the adb logcat process.
List
<
String
>
args
=
<
String
>[
'-s'
,
device
.
id
,
'logcat'
,
'-v'
,
'tag'
,
// Only log the tag and the message
'-s'
,
'flutter:V'
,
'ActivityManager:W'
,
'System.err:W'
,
'*:F'
];
List
<
String
>
args
=
<
String
>[
'logcat'
,
'-v'
,
'tag'
];
String
lastTimestamp
=
device
.
lastLogcatTimestamp
;
if
(
lastTimestamp
!=
null
)
args
.
addAll
(<
String
>[
'-T'
,
lastTimestamp
]);
args
.
addAll
(<
String
>[
'-s'
,
'flutter:V'
,
'ActivityManager:W'
,
'System.err:W'
,
'*:F'
]);
_process
=
await
runCommand
(
device
.
adbCommandForDevice
(
args
));
_stdoutSubscription
=
_process
.
stdout
.
transform
(
UTF8
.
decoder
)
...
...
packages/flutter_tools/lib/src/commands/logs.dart
View file @
ad7fd3e4
...
...
@@ -55,9 +55,9 @@ class LogsCommand extends FlutterCommand {
StreamSubscription
subscription
=
reader
.
lines
.
listen
((
String
line
)
{
if
(
devices
.
length
>
1
)
{
// Prefix with the name of the device.
print
(
'[
${reader.name}
]
$line
'
);
print
Status
(
'[
${reader.name}
]
$line
'
);
}
else
{
print
(
line
);
print
Status
(
line
);
}
});
// Wait for the log reader to be finished.
...
...
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