2017 © Pedro Peláez
 

library debug

image

asgard/debug

  • Monday, February 12, 2018
  • by leyou
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,591 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Debug

The debug package helps to handle errors and display debugging information to the developer., (*1)

, (*2)

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., (*3)

composer require asgard/debug 0.*

, (*4)

ErrorHandler

Register an error handler, (*5)

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

Ignore PHP errors in a specific directory, (*6)

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

Set the logger, (*7)

$errorHandler->setLogger($logger);

The logger should implement \Psr\Log\LoggerInterface., (*8)

Check if the error handler has a logger, (*9)

$errorHandler->isLogging();

Get the backtrace from an exception, (*10)

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

To log PHP errors, (*11)

$errorHandler->setLogPHPErrors(true);

Log an exception, (*12)

$errorHandler->logException($e);

Log an error, (*13)

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

Severity should be one of the these., (*14)

Activate/Desactivate debugging, (*15)

$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., (*16)

, (*17)

Debug

Display the debug screen:, (*18)

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

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

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

Contributing

Please submit all issues and pull requests to the asgardphp/asgard repository., (*20)

License

The Asgard framework is open-sourced software licensed under the MIT license, (*21)

The Versions

12/02 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michel Hognerud

13/05 2016

v0.3.1

0.3.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michel Hognerud

12/05 2016

v0.3.0

0.3.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michel Hognerud

13/06 2015

v0.2.0

0.2.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michel Hognerud

09/09 2014

v0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

 

by Michel Hognerud