From 8f9333a27381d645a0508f9d12f27d296877006b Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 28 Oct 2024 19:37:51 -0400 Subject: [PATCH] Removed unused LogHandlerType --- src/LogLib/Enums/LogHandlerType.php | 9 -------- src/LogLib/Handlers/ConsoleLogging.php | 9 -------- src/LogLib/Handlers/FileLogging.php | 23 ------------------- src/LogLib/Interfaces/LogHandlerInterface.php | 9 -------- 4 files changed, 50 deletions(-) delete mode 100644 src/LogLib/Enums/LogHandlerType.php diff --git a/src/LogLib/Enums/LogHandlerType.php b/src/LogLib/Enums/LogHandlerType.php deleted file mode 100644 index ad21d81..0000000 --- a/src/LogLib/Enums/LogHandlerType.php +++ /dev/null @@ -1,9 +0,0 @@ -append($output); } - public static function getType(): LogHandlerType - { - return LogHandlerType::FILE; - } - private static function getLogger(Application $application): FileLock { if(!isset(self::$application_logs[$application->getApplicationName()])) @@ -98,23 +92,6 @@ class FileLogging implements LogHandlerInterface return $logging_file; } - private static function getExceptionFile(Application $application, \Throwable $e): string - { - $logging_directory = $application->getFileLoggingDirectory(); - - if(!is_writable($logging_directory)) - { - throw new LoggingException(sprintf("Cannot write to %s due to insufficient permissions", $logging_directory)); - } - - if(!file_exists($logging_directory)) - { - mkdir($logging_directory); - } - - return Utilities::sanitizeFileName($application->getApplicationName()) . '-' . Utilities::sanitizeFileName(get_class($e)) . '-' . date('d-m-Y-H-i-s') . '.json'; - } - private static function getTimestamp(): string { return date('yd/m/y H:i'); diff --git a/src/LogLib/Interfaces/LogHandlerInterface.php b/src/LogLib/Interfaces/LogHandlerInterface.php index 1df12b4..2e211c3 100644 --- a/src/LogLib/Interfaces/LogHandlerInterface.php +++ b/src/LogLib/Interfaces/LogHandlerInterface.php @@ -2,11 +2,9 @@ namespace LogLib\Interfaces; -use LogLib\Enums\LogHandlerType; use LogLib\Exceptions\LoggingException; use LogLib\Objects\Application; use LogLib\Objects\Event; -use LogLib\Objects\Options; interface LogHandlerInterface { @@ -19,11 +17,4 @@ interface LogHandlerInterface * @throws LoggingException If an error occurs while handling the event */ public static function handle(Application $application, Event $event): void; - - /** - * Returns the type of log handler. - * - * @return LogHandlerType - */ - public static function getType(): LogHandlerType; } \ No newline at end of file