Reduce line of output to 80 chars (or around)
This commit is contained in:
@@ -50,28 +50,30 @@ class StatusAction(action.Action):
|
|||||||
def _print_status(self, component, result):
|
def _print_status(self, component, result):
|
||||||
if not result:
|
if not result:
|
||||||
LOG.info("Status of %s is %s.", colorizer.quote(component.name), self._quote_status(STATUS_UNKNOWN))
|
LOG.info("Status of %s is %s.", colorizer.quote(component.name), self._quote_status(STATUS_UNKNOWN))
|
||||||
elif len(result) == 1:
|
return
|
||||||
|
|
||||||
|
def details_printer(entry, spacing):
|
||||||
|
det = utils.truncate_text(entry.details, max_len=8192, from_bottom=True)
|
||||||
|
for line in det.splitlines():
|
||||||
|
line = line.replace("\t", "\\t")
|
||||||
|
line = line.replace("\r", "\\r")
|
||||||
|
line = utils.truncate_text(line, max_len=120)
|
||||||
|
LOG.info("%s>> %s", (" " * spacing), line)
|
||||||
|
|
||||||
|
if len(result) == 1:
|
||||||
s = result[0]
|
s = result[0]
|
||||||
if s.name and s.name != component.name:
|
if s.name and s.name != component.name:
|
||||||
LOG.info("Status of %s (%s) is %s.", colorizer.quote(component.name), s.name, self._quote_status(s.status))
|
LOG.info("Status of %s (%s) is %s.", colorizer.quote(component.name), s.name, self._quote_status(s.status))
|
||||||
else:
|
else:
|
||||||
LOG.info("Status of %s is %s.", colorizer.quote(component.name), self._quote_status(s.status))
|
LOG.info("Status of %s is %s.", colorizer.quote(component.name), self._quote_status(s.status))
|
||||||
if self.show_full and s.details:
|
if self.show_full and s.details:
|
||||||
det = utils.truncate_text(s.details, max_len=8192, from_bottom=True)
|
details_printer(s, 2)
|
||||||
for line in det.splitlines():
|
|
||||||
line = line.replace("\t", "\\t")
|
|
||||||
line = line.replace("\r", "\\r")
|
|
||||||
LOG.info("%s>> %s", " " * 2, line)
|
|
||||||
else:
|
else:
|
||||||
LOG.info("Status of %s is:", colorizer.quote(component.name))
|
LOG.info("Status of %s is:", colorizer.quote(component.name))
|
||||||
for s in result:
|
for s in result:
|
||||||
LOG.info("|-- %s is %s.", s.name, self._quote_status(s.status))
|
LOG.info("|-- %s is %s.", s.name, self._quote_status(s.status))
|
||||||
if self.show_full and s.details:
|
if self.show_full and s.details:
|
||||||
det = utils.truncate_text(s.details, max_len=8192, from_bottom=True)
|
details_printer(s, 4)
|
||||||
for line in det.splitlines():
|
|
||||||
line = line.replace("\t", "\\t")
|
|
||||||
line = line.replace("\r", "\\r")
|
|
||||||
LOG.info("%s>> %s", " " * 4, line)
|
|
||||||
|
|
||||||
def _run(self, persona, component_order, instances):
|
def _run(self, persona, component_order, instances):
|
||||||
self._run_phase(
|
self._run_phase(
|
||||||
|
|||||||
Reference in New Issue
Block a user