diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php index 7221816b7116..0111b693ef1a 100644 --- a/core/Command/Log/Manage.php +++ b/core/Command/Log/Manage.php @@ -59,7 +59,7 @@ protected function configure() { 'level', null, InputOption::VALUE_REQUIRED, - 'set the log level [debug, info, warning, error]' + 'set the log level [debug, info, warning, error, fatal]' ) ->addOption( 'timezone', @@ -149,6 +149,8 @@ protected function convertLevelString($level) { case 'error': case 'err': return 3; + case 'fatal': + return 4; } throw new \InvalidArgumentException('Invalid log level string'); } @@ -168,7 +170,10 @@ protected function convertLevelNumber($levelNum) { return 'Warning'; case 3: return 'Error'; + case 4: + return 'Fatal'; } throw new \InvalidArgumentException('Invalid log level number'); } } + diff --git a/tests/TestHelpers/LoggingHelper.php b/tests/TestHelpers/LoggingHelper.php index 0abe0dbee042..aa020b2ef650 100644 --- a/tests/TestHelpers/LoggingHelper.php +++ b/tests/TestHelpers/LoggingHelper.php @@ -57,7 +57,7 @@ public static function getLogFilePath($ocPath) { } /** - * returns the currently set log level [debug, info, warning, error] + * returns the currently set log level [debug, info, warning, error, fatal] * * @param string $ocPath * @throws \Exception @@ -80,13 +80,13 @@ public static function getLogLevel($ocPath) { /** * * @param string $ocPath - * @param string $logLevel (debug|info|warning|error) + * @param string $logLevel (debug|info|warning|error|fatal) * @return void * @throws \InvalidArgumentException * @throws \Exception */ public static function setLogLevel($ocPath, $logLevel) { - if (!in_array($logLevel, ["debug", "info", "warning", "error"])) { + if (!in_array($logLevel, ["debug", "info", "warning", "error", "fatal"])) { throw new \InvalidArgumentException("invalid log level"); } $result = SetupHelper::runOcc(["log:manage", "--level=$logLevel"], $ocPath); @@ -282,4 +282,4 @@ public static function tailFile( } return $output; } -} \ No newline at end of file +}