jinowom / yii2-pay-supports
common components
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: 2025-03-01 00:34:28 UTC
README
handle with array/config/log/guzzle etc.
About log
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; } }
Usage
After registerLog, you can use Log service:
ApplicationLogger::debug('test', ['test log']);