From 2ad33bc06ec0d4eaa9db287f06c4b204718fba4e Mon Sep 17 00:00:00 2001
From: Tim Terhorst <mynamewastaken+gitlab@gmail.com>
Date: Tue, 1 Oct 2019 18:27:45 -0500
Subject: [PATCH] Add Fatal logging option

Signed-off-by: Tim Terhorst <mynamewastaken+gitlab@gmail.com>
---
 core/Command/Log/Manage.php           | 8 ++++++--
 tests/Core/Command/Log/ManageTest.php | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php
index 5a1dd3d048b..1015235f6ef 100644
--- a/core/Command/Log/Manage.php
+++ b/core/Command/Log/Manage.php
@@ -62,7 +62,7 @@ class Manage extends Command implements CompletionAwareInterface {
 				'level',
 				null,
 				InputOption::VALUE_REQUIRED,
-				'set the log level [debug, info, warning, error]'
+				'set the log level [debug, info, warning, error, fatal]'
 			)
 			->addOption(
 				'timezone',
@@ -152,6 +152,8 @@ class Manage extends Command implements CompletionAwareInterface {
 		case 'error':
 		case 'err':
 			return 3;
+		case 'fatal':
+			return 4;
 		}
 		throw new \InvalidArgumentException('Invalid log level string');
 	}
@@ -171,6 +173,8 @@ class Manage extends Command implements CompletionAwareInterface {
 			return 'Warning';
 		case 3:
 			return 'Error';
+		case 4:
+			return 'Fatal';
 		}
 		throw new \InvalidArgumentException('Invalid log level number');
 	}
@@ -184,7 +188,7 @@ class Manage extends Command implements CompletionAwareInterface {
 		if ($optionName === 'backend') {
 			return ['file', 'syslog', 'errorlog', 'systemd'];
 		} else if ($optionName === 'level') {
-			return ['debug', 'info', 'warning', 'error'];
+			return ['debug', 'info', 'warning', 'error', 'fatal'];
 		} else if ($optionName === 'timezone') {
 			return \DateTimeZone::listIdentifiers();
 		}
diff --git a/tests/Core/Command/Log/ManageTest.php b/tests/Core/Command/Log/ManageTest.php
index 4b026f14847..2044fc4de90 100644
--- a/tests/Core/Command/Log/ManageTest.php
+++ b/tests/Core/Command/Log/ManageTest.php
@@ -110,6 +110,7 @@ class ManageTest extends TestCase {
 			['wArn', 2],
 			['error', 3],
 			['eRr', 3],
+			['fAtAl', 4],
 		];
 	}
 
@@ -135,6 +136,7 @@ class ManageTest extends TestCase {
 			[1, 'Info'],
 			[2, 'Warning'],
 			[3, 'Error'],
+			[4, 'Fatal'],
 		];
 	}
 
-- 
GitLab