wj008 / debug
PHP 集成框架内核
1.0.2
2020-12-03 05:42 UTC
Requires
- php: >=7.0
This package is not auto-updated.
Last update: 2024-09-20 00:01:24 UTC
README
安装
composer require wj008/debug
需要与调试服务器配合使用,PHP socket 端口需要开启
使用:
use debug\Logger; Logger::log("test", "xxxx", 3); Logger::info("xxxxdsd", ["xxxx"], ["cccc" => "xxx"]); Logger::log(false); function a() { throw new \Exception("这个是一个测试错误信息"); } function b() { a(); } try { b(); } catch (\Exception $e) { Logger::error($e->getMessage(), PHP_EOL. $e->getTraceAsString()); } $time1 = microtime(true); //执行sql 耗时 usleep(50000); $time2 = microtime(true); Logger::sql('select * from table where pid=1 and name="xxxx"', $time2 - $time1);