wj008 / debug
beacon framework kernel of PHP
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/wj008/debug
Requires
- php: >=7.0
This package is not auto-updated.
Last update: 2025-10-03 04:57:31 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);