yansongda / supports
common components
Installs: 797 327
Dependents: 34
Suggesters: 0
Security: 0
Stars: 20
Watchers: 2
Forks: 16
Open Issues: 0
Requires
- php: >=8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.4
- phpstan/phpstan: ^1.1.0
- phpunit/phpunit: ^9.0
Suggests
- monolog/monolog: Use logger
- symfony/console: Use stdout logger
- dev-master
- v4.0.2
- v4.0.1
- v4.0.0
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.0
- v2.1.14
- v2.1.13
- v2.1.12
- v2.1.11
- v2.1.10
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.9.0
- v1.8.8
- v1.8.7
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
This package is auto-updated.
Last update: 2023-11-19 13:55:49 UTC
README
handle with array/config/log/guzzle etc.
About log
use Yansongda\Supports\Logger as Log; use Monolog\Logger; class ApplicationLogger { private static $logger; /** * Forward call. * * @author yansongda <me@yansongda.cn> * * @return mixed */ public static function __callStatic(string $method, array $args) { return call_user_func_array([self::getLogger(), $method], $args); } /** * Forward call. * * @author yansongda <me@yansongda.cn> * * @return mixed */ public function __call(string $method, array $args) { return call_user_func_array([self::getLogger(), $method], $args); } /** * Make a default log instance. * * @author yansongda <me@yansongda.cn> * * @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']);