承接 femastudios/jtrace 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

femastudios/jtrace

最新稳定版本:v1.0.1

Composer 安装命令:

composer require femastudios/jtrace

包简介

A PHP library to create Java-like stacktraces

README 文档

README

A PHP library to create Java-like stacktraces.

Installation through composer package femastudios/jtrace

Usage

// Create a JTrace class
$jtrace = JTrace::new();
// $e is a \Throwable instance
$jtrace->fromThrowable($e); // Returns the stacktrace as a string
$jtrace->printFromThrowable($e); // Prints the stacktrace

Sample output:

LogicException (0): Inner threw
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:16
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:14->run()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:18

Caused by:
Exception (101): Inner message
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:9
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:14->runInner()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:14->run()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:18

Options

Each JTrace instance can be customized with the following parameters:

  • Max items: the maximum number of lines to print for each \Throwable. Defaults to 256.
  • Max causes: the maximum number of causes to print. Defaults to 64.
  • Include arguments: whether to include arguments of function calls in the stacktrace. Defaults to false.
    • Include complex arguments: whether to include non-trivial arguments in function calls. When false scalar types are written normally, for other types the type is written. When true an attempt to convert classes an arrays to string is made. Defaults to false.
    • Arguments max length: the maximum length for all the arguments for each line. When exceeded arguments are automatically separately shortened according to their size. Defaults to 1024.

Example of customization:

JTrace::new()
    ->includeBaseArgs() // Includes only scalar args
    ->maxItems(null) // Removes the items limit
    ->maxCauses(8); // Limits the number of chained exceptions to 8

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2020-06-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固