asgard/debug 问题修复 & 功能扩展

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

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

asgard/debug

Composer 安装命令:

composer require asgard/debug

包简介

README 文档

README

#Debug

The debug package helps to handle errors and display debugging information to the developer.

##Installation If you are working on an Asgard project you don't need to install this library as it is already part of the standard libraries.

composer require asgard/debug 0.*

##ErrorHandler

Register an error handler

$errorHandler = \Asgard\Debug\ErrorHandler::register();

Ignore PHP errors in a specific directory

$errorHandler->ignoreDir('libs/old_legay_package/');

Set the logger

$errorHandler->setLogger($logger);

The logger should implement \Psr\Log\LoggerInterface.

Check if the error handler has a logger

$errorHandler->isLogging();

Get the backtrace from an exception

$trace = $errorHandler->getBacktraceFromException($e);

To log PHP errors

$errorHandler->setLogPHPErrors(true);

Log an exception

$errorHandler->logException($e);

Log an error

$errorHandler->log($severity, $message, $file, $line, $trace);

Severity should be one of the these.

Activate/Desactivate debugging

$errorHandler->setDebug(true);
$errorHandler->setDebug(false);

If debug is set to true, the error handler will display a debugging page to the user when stumbling upon an error, otherwise it will be hidden.

##Debug

Display the debug screen:

\Asgard\Debug\d($var1, $var2, ...);

In an Asgard application, the global function d() is an alias of \Asgard\Debug\d:

d($var1, $var2, ...);

###Contributing

Please submit all issues and pull requests to the asgardphp/asgard repository.

License

The Asgard framework is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固