Skip to content

Commit b2a9e91

Browse files
authored
Merge pull request #33497 from andrewbess/improvement/CE-32868-update-monolog-to-latest-version
Updated monolog/monolog to 2.3.1
2 parents 2136092 + 4eca2e2 commit b2a9e91

File tree

11 files changed

+171
-173
lines changed

11 files changed

+171
-173
lines changed

app/code/Magento/Developer/Model/Logger/Handler/Debug.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Developer\Model\Logger\Handler;
79

10+
use Exception;
811
use Magento\Config\Setup\ConfigOptionsList;
9-
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\DeploymentConfig;
1013
use Magento\Framework\App\State;
14+
use Magento\Framework\Exception\FileSystemException;
15+
use Magento\Framework\Exception\RuntimeException;
1116
use Magento\Framework\Filesystem\DriverInterface;
12-
use Magento\Framework\App\DeploymentConfig;
17+
use Magento\Framework\Logger\Handler\Debug as DebugHandler;
1318

1419
/**
1520
* Enable/disable debug logging based on the store config setting
1621
*/
17-
class Debug extends \Magento\Framework\Logger\Handler\Debug
22+
class Debug extends DebugHandler
1823
{
1924
/**
2025
* @var State
@@ -30,14 +35,14 @@ class Debug extends \Magento\Framework\Logger\Handler\Debug
3035
* @param DriverInterface $filesystem
3136
* @param State $state
3237
* @param DeploymentConfig $deploymentConfig
33-
* @param string $filePath
34-
* @throws \Exception
38+
* @param string|null $filePath
39+
* @throws Exception
3540
*/
3641
public function __construct(
3742
DriverInterface $filesystem,
3843
State $state,
3944
DeploymentConfig $deploymentConfig,
40-
$filePath = null
45+
?string $filePath = null
4146
) {
4247
parent::__construct($filesystem, $filePath);
4348

@@ -48,30 +53,34 @@ public function __construct(
4853
/**
4954
* @inheritdoc
5055
*/
51-
public function isHandling(array $record)
56+
public function isHandling(array $record): bool
5257
{
5358
if ($this->deploymentConfig->isAvailable()) {
54-
return
55-
parent::isHandling($record)
56-
&& $this->isLoggingEnabled();
59+
return parent::isHandling($record) && $this->isLoggingEnabled();
5760
}
5861

5962
return parent::isHandling($record);
6063
}
6164

6265
/**
63-
* Check that logging functionality is enabled.
66+
* Check that logging functionality is enabled
6467
*
6568
* @return bool
69+
* @throws FileSystemException
70+
* @throws RuntimeException
6671
*/
6772
private function isLoggingEnabled(): bool
6873
{
69-
$configValue = $this->deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_DEBUG_LOGGING);
74+
$configValue = $this->deploymentConfig->get(
75+
ConfigOptionsList::CONFIG_PATH_DEBUG_LOGGING
76+
);
77+
7078
if ($configValue === null) {
7179
$isEnabled = $this->state->getMode() !== State::MODE_PRODUCTION;
7280
} else {
73-
$isEnabled = (bool)$configValue;
81+
$isEnabled = (bool) $configValue;
7482
}
83+
7584
return $isEnabled;
7685
}
7786
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"magento/composer": "1.7.0",
6464
"magento/magento-composer-installer": ">=0.1.11",
6565
"magento/zendframework1": "~1.14.2",
66-
"monolog/monolog": "^1.17",
66+
"monolog/monolog": "^2.3",
6767
"pelago/emogrifier": "^5.0.0",
6868
"php-amqplib/php-amqplib": "~3.0.0",
6969
"phpseclib/mcrypt_compat": "1.0.8",

composer.lock

Lines changed: 62 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)