jinowom/ yii2-pay-supports
通用组件
v2.0
2022-08-03 10:29 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^6.5|^7.0.1
- monolog/monolog: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- phpunit/phpunit: ^7.5
- predis/predis: ^1.1
- symfony/console: ^5.1
Suggests
- predis/predis: Allows to use throttle feature
- symfony/console: Use stdout logger
This package is auto-updated.
Last update: 2024-09-30 01:32:33 UTC
README
使用数组/config/log/guzzle等进行处理
关于日志
use jinowom\Supports\Logger as Log; use Monolog\Logger; class ApplicationLogger { private static $logger; /** * Forward call. * * @author jinowom <chareler@163.com> * * @return mixed */ public static function __callStatic(string $method, array $args) { return call_user_func_array([self::getLogger(), $method], $args); } /** * Forward call. * * @author jinowom <chareler@163.com> * * @return mixed */ public function __call(string $method, array $args) { return call_user_func_array([self::getLogger(), $method], $args); } /** * Make a default log instance. * * @author jinowom <chareler@163.com> * * @return Log */ public static function getLogger() { if (! self::$logger instanceof Logger) { self::$logger = new Log(); } return self::$logger; } }
用法
在注册Log之后,你可以使用Log服务
ApplicationLogger::debug('test', ['test log']);