Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/Command/Log/Manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');
}
Expand All @@ -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');
}
}

8 changes: 4 additions & 4 deletions tests/TestHelpers/LoggingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -282,4 +282,4 @@ public static function tailFile(
}
return $output;
}
}
}