From f12cc27bc4fb9c861edacd3b98024ab564d1ef12 Mon Sep 17 00:00:00 2001 From: yansongda Date: Mon, 26 Jul 2021 22:01:30 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E9=BB=98=E8=AE=A4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Logger.php | 4 +++- src/Service/ConfigServiceProvider.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Logger.php b/src/Logger.php index 5ac63b0..1f59518 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Yansongda\Pay; +use Yansongda\Pay\Contract\ConfigInterface; use Yansongda\Pay\Contract\LoggerInterface; use Yansongda\Pay\Exception\InvalidConfigException; @@ -28,7 +29,8 @@ class Logger */ public static function __callStatic(string $method, array $args): void { - if (!Pay::hasContainer() || !Pay::has(LoggerInterface::class)) { + if (!Pay::hasContainer() || !Pay::has(LoggerInterface::class) || + false === Pay::get(ConfigInterface::class)->get('logger.enable')) { return; } diff --git a/src/Service/ConfigServiceProvider.php b/src/Service/ConfigServiceProvider.php index bc0006e..de9d9e4 100644 --- a/src/Service/ConfigServiceProvider.php +++ b/src/Service/ConfigServiceProvider.php @@ -15,8 +15,8 @@ class ConfigServiceProvider implements ServiceProviderInterface * @var array */ private $config = [ - 'log' => [ - 'enable' => true, + 'logger' => [ + 'enable' => false, 'file' => null, 'identify' => 'yansongda.pay', 'level' => 'debug',