Removed unused LoggingException

This commit is contained in:
netkas 2024-10-28 19:47:20 -04:00
parent 7e779ab41b
commit 735dc7b33e
6 changed files with 8 additions and 35 deletions

View file

@ -7,10 +7,10 @@ use LogLib\Classes\Utilities;
use LogLib\Classes\Validate;
use LogLib\Enums\ConsoleColors;
use LogLib\Enums\LogLevel;
use LogLib\Exceptions\LoggingException;
use LogLib\Interfaces\LogHandlerInterface;
use LogLib\Objects\Application;
use LogLib\Objects\Event;
use RuntimeException;
use Throwable;
class ConsoleLogging implements LogHandlerInterface
@ -77,7 +77,6 @@ class ConsoleLogging implements LogHandlerInterface
*
* @param string $application_name The application name
* @return string The formatted application name
* @throws LoggingException If unable to generate a random color for the application
*/
private static function formatAppColor(string $application_name): string
{
@ -91,7 +90,7 @@ class ConsoleLogging implements LogHandlerInterface
}
catch (Exception $e)
{
throw new LoggingException(sprintf('Unable to generate random color for application "%s"', $application_name), $e->getCode(), $e);
throw new RuntimeException(sprintf('Unable to generate random color for application "%s"', $application_name), $e->getCode(), $e);
}
self::$application_colors[$application_name] = $color;

View file

@ -6,10 +6,10 @@ use LogLib\Classes\FileLock;
use LogLib\Classes\Utilities;
use LogLib\Classes\Validate;
use LogLib\Enums\LogLevel;
use LogLib\Exceptions\LoggingException;
use LogLib\Interfaces\LogHandlerInterface;
use LogLib\Objects\Application;
use LogLib\Objects\Event;
use RuntimeException;
use Throwable;
class FileLogging implements LogHandlerInterface
@ -80,7 +80,6 @@ class FileLogging implements LogHandlerInterface
*
* @param Application $application The application instance for which the log file is to be retrieved.
* @return string The full path of the log file.
* @throws LoggingException If the logging directory is not writable or cannot be created.
*/
private static function getLogFile(Application $application): string
{
@ -88,7 +87,7 @@ class FileLogging implements LogHandlerInterface
if(!is_writable($logging_directory))
{
throw new LoggingException(sprintf("Cannot write to %s due to insufficient permissions", $logging_directory));
throw new RuntimeException(sprintf("Cannot write to %s due to insufficient permissions", $logging_directory));
}
if(!file_exists($logging_directory))