Bug 1290114 - Make Android test logging more responsive; r=ahal
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -340,19 +340,23 @@ class RemoteAutomation(Automation):
print newLogContent
return True
self.logBuffer += newLogContent
lines = self.logBuffer.split('\n')
lines = [l for l in lines if l]
if lines:
- # We only keep the last (unfinished) line in the buffer
- self.logBuffer = lines[-1]
- del lines[-1]
+ if self.logBuffer.endswith('\n'):
+ # all lines are complete; no need to buffer
+ self.logBuffer = ""
+ else:
+ # keep the last (unfinished) line in the buffer
+ self.logBuffer = lines[-1]
+ del lines[-1]
if not lines:
return False
for line in lines:
# This passes the line to the logger (to be logged or buffered)
parsed_messages = self.messageLogger.write(line)
for message in parsed_messages: