update: 默认日志配置统一

This commit is contained in:
yansongda 2021-07-26 22:01:30 +08:00
parent bd5771faa6
commit f12cc27bc4
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

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