定制 apex/debugger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固