apex/debugger
Composer 安装命令:
composer require apex/debugger
包简介
Lightweight, portable debugger for use in any application.
README 文档
README
A lightweight, portable debugger that can easily be used within any application to gather and analyze details of requests. It supports:
- Combines PSR-3 compliant logging for simplicity, so one call will add line item to both debugger and logger.
- Use any numeric debug level to signify the detail of messages when both, adding debug messages and compiling debug sessions.
- Retrieve and analyze session information via command line tool, rendered HTML, or PHP arrays.
- Saves basic request info, debug messages including caller (file, line, class, method), full backtrace, inputs (post, get, cookie, et al), and any optional items.
Installation
Install via Composer with:
composer require apex/debugger
Table of Contents
- Debugger
- Reading Debug Sessions
Basic Usage
use Apex\Debugger\Debugger; // Init debugger $debugger = new Debugger(3); // 3 = detail level of debug messages to log // Throughout your code, add debug items. $debugger->add(3, "My debug line item...", 'notice'); // 'notice' will add to PSR-3 logger as well. // Add more detailed line at level 5, no logging $debugger->add(5, 'Detailed item'); // At end of request, or within exception handler, finish up and save debug session $session = $debugger->finish(); // Within exception handler function handleException(Exception $e) { $debugger->finish($e); }
Reading Debug Sessions
Simply run the PHP script located at /vendor/bin/debugger in your installation:
php ./vendor/bin/debugger
The menu based command line tool will start showing a list of recently saved debug sessions, which you may enter into. The next screen shows another menu allowing you to select the exact information you would like to view regarding the request. Instead of the command line tool, you may also retrieve debug sessions via the HTML Loader or the ArrayLoader.
Follow Apex
Loads of good things coming in the near future including new quality open source packages, more advanced articles / tutorials that go over down to earth useful topics, et al. Stay informed by joining the mailing list on our web site, or follow along on Twitter at @ApexPlatform.
apex/debugger 适用场景与选型建议
apex/debugger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 892 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 02 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 apex/debugger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 apex/debugger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 892
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 4
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-28