Error Handling Library
Error Handling Library, This library can handle logging and displaying of the errors, you can also register listener for special error cases such as if you want to handle specific error/exception in different way, or want to extend/replace the Structured data, It can log to multiple services defined by the user, it can also handle different output streams, there is also Policy class to handle Different requirement of logging/displaying/exiting of the application.
Im working to support Psr3 there is minimal support right now with Logger Class and PSR3 abstract class, we may have to refactor major parts to be compatiable with it.
$ composer require arabcoders/errors
<?php require __DIR__ . '/../../autoload.php'; $error = new \arabcoders\errors\Error(); $error->addLogger( 'default', new \arabcoders\errors\Logging\Syslog() ) ->setOutput( new \arabcoders\errors\Output\HTML() ); //-- or you can use (bool)true in constructor to init default logger/output like $error = new \arabcoders\errors\Error(true); trigger_error( 'test Warning', \E_USER_WARNING);
cd vendor/arabcoders/errors; composer update ./vendor/bin/phpunit tests/