1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-09-23 04:11:54 +01:00

LogcatCollector: Learn to pass format to logcat

logcat -v lets you specify the format for the logcat output.  Add a
parameter to the LogcatCollector to allow us to pass that information
down to the logcat invocation.
This commit is contained in:
Javi Merino
2020-04-16 16:18:56 +01:00
committed by Marc Bonnici
parent 07cad78046
commit 569e4bd057
2 changed files with 8 additions and 3 deletions

View File

@@ -714,11 +714,12 @@ class LogcatMonitor(object):
def logfile(self):
return self._logfile
def __init__(self, target, regexps=None):
def __init__(self, target, regexps=None, logcat_format=None):
super(LogcatMonitor, self).__init__()
self.target = target
self._regexps = regexps
self._logcat_format = logcat_format
self._logcat = None
self._logfile = None
@@ -750,6 +751,9 @@ class LogcatMonitor(object):
else:
logcat_cmd = '{} | grep {}'.format(logcat_cmd, quote(regexp))
if self._logcat_format:
logcat_cmd = "{} -v {}".format(logcat_cmd, quote(self._logcat_format))
logcat_cmd = get_adb_command(self.target.conn.device, logcat_cmd)
logger.debug('logcat command ="{}"'.format(logcat_cmd))