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
c3e618fe
Commit
c3e618fe
authored
Sep 03, 2015
by
Ian Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a clear flag for sky_tool logs on Android.
parent
aa8942f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
sky_tool
packages/flutter/lib/sky_tool
+17
-6
No files found.
packages/flutter/lib/sky_tool
View file @
c3e618fe
...
...
@@ -151,6 +151,8 @@ class SkyLogs(object):
def
add_subparser
(
self
,
subparsers
):
logs_parser
=
subparsers
.
add_parser
(
'logs'
,
help
=
'Show logs for running Sky apps'
)
logs_parser
.
add_argument
(
'--clear'
,
action
=
'store_true'
,
dest
=
'clear_logs'
,
help
=
'Clear log history before reading from logs (currently only implemented for Android)'
)
logs_parser
.
set_defaults
(
func
=
self
.
run
)
def
run
(
self
,
args
,
pids
):
...
...
@@ -160,13 +162,13 @@ class SkyLogs(object):
android
=
AndroidDevice
()
if
android
.
is_connected
():
android_log_reader
=
android
.
logs
()
android_log_reader
=
android
.
logs
(
args
.
clear_logs
)
if
IOSDevice
.
is_connected
():
ios_dev_log_reader
=
IOSDevice
.
logs
()
ios_dev_log_reader
=
IOSDevice
.
logs
(
args
.
clear_logs
)
if
IOSSimulator
.
is_connected
():
ios_sim_log_reader
=
IOSSimulator
.
logs
()
ios_sim_log_reader
=
IOSSimulator
.
logs
(
args
.
clear_logs
)
if
android_log_reader
is
not
None
:
try
:
...
...
@@ -488,8 +490,17 @@ class AndroidDevice(object):
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_output
(
cmd
)
def
logs
(
self
):
def
logs
(
self
,
clear
=
False
):
def
do_logs
():
if
clear
:
cmd
=
[
self
.
adb_path
,
'logcat'
,
'-c'
]
logging
.
info
(
' '
.
join
(
cmd
))
subprocess
.
check_call
(
cmd
)
cmd
=
[
self
.
adb_path
,
'logcat'
,
...
...
@@ -603,7 +614,7 @@ class IOSDevice(object):
pass
@
classmethod
def
logs
(
cls
):
def
logs
(
cls
,
clear
=
False
):
try
:
cmd
=
[
'which'
,
...
...
@@ -734,7 +745,7 @@ class IOSSimulator(object):
return
cls
.
is_booted
()
@
classmethod
def
logs
(
cls
):
def
logs
(
cls
,
clear
=
False
):
def
do_logs
():
cmd
=
[
'tail'
,
...
...
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