From 70abc47ae00a7dfafc30afc445d12c48144c6e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 7 Mar 2020 22:22:23 +0100 Subject: [PATCH] Improved event log console output. --- src/Command/ShowEventLogCommand.php | 4 ++++ src/Services/LogSystem/LogEntryExtraFormatter.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Command/ShowEventLogCommand.php b/src/Command/ShowEventLogCommand.php index 0097ea4d..e03afc0f 100644 --- a/src/Command/ShowEventLogCommand.php +++ b/src/Command/ShowEventLogCommand.php @@ -137,6 +137,7 @@ class ShowEventLogCommand extends Command $headers = ['ID', 'Timestamp', 'Type', 'User', 'Target Type', 'Target']; if ($showExtra) { $headers[] = 'Extra data'; + $table->setColumnMaxWidth(6, 50); } $table->setHeaders($headers); @@ -144,6 +145,9 @@ class ShowEventLogCommand extends Command $this->addTableRow($table, $entry, $showExtra); } + $table->setColumnMaxWidth(3, 20); + $table->setColumnMaxWidth(5, 30); + $table->render(); } diff --git a/src/Services/LogSystem/LogEntryExtraFormatter.php b/src/Services/LogSystem/LogEntryExtraFormatter.php index d251405d..b28623d8 100644 --- a/src/Services/LogSystem/LogEntryExtraFormatter.php +++ b/src/Services/LogSystem/LogEntryExtraFormatter.php @@ -67,8 +67,8 @@ class LogEntryExtraFormatter protected $translator; protected $elementTypeNameGenerator; - protected const CONSOLE_SEARCH = ['', '', '', '', ' ']; - protected const CONSOLE_REPLACE = ['', '', '', '', '→']; + protected const CONSOLE_SEARCH = ['', '', '', '', '', ]; + protected const CONSOLE_REPLACE = ['→', '', '', '', '']; public function __construct(TranslatorInterface $translator, ElementTypeNameGenerator $elementTypeNameGenerator) {