From 4f64c974a6290f84f45668c3485cfd2cd7da18a5 Mon Sep 17 00:00:00 2001 From: Bartosz Kubicki Date: Tue, 24 Mar 2020 15:40:25 +0100 Subject: [PATCH] Fix for incorrect severity level propagtion --- CHANGELOG.md | 7 +++++-- composer.json | 2 +- .../OnlySelfSeverityLevelAwareHandler.php | 21 +++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c4158e..171d2fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ -1.0.0. -* releasing handler which handles records belonging only strictly to its severity \ No newline at end of file +1.0.0 +* releasing handler which handles records belonging only strictly to its severity + +1.0.1 +* fix for incorrect severity level propagation \ No newline at end of file diff --git a/composer.json b/composer.json index b4f5966..9f107d3 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "email": "b.w.kubicki@gmail.com" } ], - "version": "1.0.0", + "version": "1.0.1", "minimum-stability": "stable", "require": { "php": "^7.2.0|~7.3.0", diff --git a/src/Handler/OnlySelfSeverityLevelAwareHandler.php b/src/Handler/OnlySelfSeverityLevelAwareHandler.php index 0907acb..667f6c1 100644 --- a/src/Handler/OnlySelfSeverityLevelAwareHandler.php +++ b/src/Handler/OnlySelfSeverityLevelAwareHandler.php @@ -11,7 +11,9 @@ namespace BKubicki\Logger\Handler; +use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Logger\Handler\Base; +use Monolog\Logger; /** * Class OnlySelfSeverityLevelAwareHandler @@ -19,6 +21,25 @@ */ class OnlySelfSeverityLevelAwareHandler extends Base { + /** + * OnlySelfSeverityLevelAwareHandler constructor. + * @param DriverInterface $filesystem + * @param string $level + * @param string|null $filePath + * @param string|null $fileName + * @throws \Exception + */ + public function __construct( + DriverInterface $filesystem, + string $level = Logger::DEBUG, + ?string $filePath = null, + ?string $fileName = null + ) { + parent::__construct($filesystem, $filePath, $fileName); + $this->loggerType = $level; + $this->level = $level; + } + /** * @param array $record * @return bool