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',