openers/supports
最新稳定版本:1.0.1
Composer 安装命令:
composer require openers/supports
包简介
common components
README 文档
README
handle with array/config/log/guzzle etc.
About log
use Estudyer\Supports\Logger as Log;
use Monolog\Logger;
class ApplicationLogger
{
private static $logger;
/**
* Forward call.
*
* @author Estudyer <me@Estudyer.cn>
*
* @return mixed
*/
public static function __callStatic(string $method, array $args)
{
return call_user_func_array([self::getLogger(), $method], $args);
}
/**
* Forward call.
*
* @author Estudyer <me@Estudyer.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 Estudyer <me@Estudyer.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']);
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-29