From ccc3378774eeac7e29444475297377e7b5a2aa41 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 29 Oct 2024 14:18:30 -0400 Subject: [PATCH] This update introduces a critical bug fix where Console logging was enabled in web environments --- CHANGELOG.md | 5 +++++ project.json | 2 +- src/LogLib/Handlers/ConsoleLogging.php | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f074303..80b5c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2024-10-29 + +This update introduces a critical bug fix where Console logging was enabled in web environments + + ## [2.0.0] - 2024-10-29 This update introduces some additional features & bug fixes diff --git a/project.json b/project.json index 5977e38..21e8ec7 100644 --- a/project.json +++ b/project.json @@ -20,7 +20,7 @@ "package": "net.nosial.loglib", "company": "Nosial", "copyright": "Copyright (c) 2022-2023 Nosial", - "version": "2.0.0", + "version": "2.0.1", "uuid": "de1deca6-7b65-11ed-a8b0-a172264634d8" }, "build": { diff --git a/src/LogLib/Handlers/ConsoleLogging.php b/src/LogLib/Handlers/ConsoleLogging.php index 0409f48..24d67f5 100644 --- a/src/LogLib/Handlers/ConsoleLogging.php +++ b/src/LogLib/Handlers/ConsoleLogging.php @@ -24,6 +24,12 @@ class ConsoleLogging implements LogHandlerInterface */ public static function handle(Application $application, Event $event): void { + // Check if the application is running in a CLI environment, if not, return + if(!Utilities::runningInCli()) + { + return; + } + // Check if the event level is enabled for console logging if(!Validate::checkLevelType($event->getLevel(), $application->getConsoleLoggingLevel())) {