Skip to content

Commit

Permalink
Merge pull request flutter#1040 from iansf/handle_logger_crashes
Browse files Browse the repository at this point in the history
Handle logger crashes.
  • Loading branch information
iansf committed Sep 3, 2015
2 parents b9f9635 + 9efc01b commit f2f277d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sky/packages/sky/lib/sky_tool
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,12 @@ class AndroidDevice(object):
log_process = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE)
while True:
try:
sys.stdout.write('ANDROID: ' + log_process.stdout.readline())
log_line = log_process.stdout.readline()
if log_line == '':
if log_process.poll() != None:
logging.error('The Android logging process has quit unexpectedly. Please call the "logs" command again.')
break
sys.stdout.write('ANDROID: ' + log_line)
sys.stdout.flush()
except KeyboardInterrupt:
break
Expand Down Expand Up @@ -635,6 +640,10 @@ class IOSDevice(object):
while True:
try:
log_line = log_process.stdout.readline()
if log_line == '':
if log_process.poll() != None:
logging.error('The iOS logging process has quit unexpectedly. Please call the "logs" command again.')
break
if re.match(r'.*SkyShell.*', log_line) is not None:
sys.stdout.write('IOS DEV: ' + log_line)
sys.stdout.flush()
Expand Down Expand Up @@ -757,6 +766,10 @@ class IOSSimulator(object):
while True:
try:
log_line = log_process.stdout.readline()
if log_line == '':
if log_process.poll() != None:
logging.error('The iOS Simulator logging process has quit unexpectedly. Please call the "logs" command again.')
break
if re.match(r'.*SkyShell.*', log_line) is not None:
sys.stdout.write('IOS SIM: ' + log_line)
sys.stdout.flush()
Expand Down

0 comments on commit f2f277d

Please sign in to comment.