apex/debugger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Debugger
  2. Reading Debug Sessions
    1. Command Line Viewer
    2. HTML Loader
    3. Array Loader

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 apex/debugger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 892
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 1
  • 推荐数: 4

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-28