2017 © Pedro Peláez
 

library exception

Better exception output & write log.

image

wilon/exception

Better exception output & write log.

  • Wednesday, September 27, 2017
  • by wilon
  • Repository
  • 1 Watchers
  • 1 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 3 % Grown

The README.md

wilon/exception

Packagist ![Packagist Release][badge_release] Packagist Downloads, (*1)

Better exception output & write log. Like Laravel., (*2)

Installation & loading

php -v >=5.3.9 Run: composer require wilon/exception:~0.1, (*3)

php -v >=5.5.9 Run: composer require wilon/exception, (*4)

Bootstrap

    (new Wilon\Exception\Handler)->bootstrap();
    // Set error_reporting(-1) & Show debug.
    // Write log to ./exceptions.log

Better :, (*5)


$errorReporting = E_ALL ^ E_NOTICE; $showErrorInfo = true; (new Wilon\Exception\Handler) ->bootstrap($errorReporting, $showErrorInfo); // Set error_reporting(E_ALL ^ E_NOTICE) & Show debug. // Write log to ./exceptions.log .

Or more Settings:, (*6)


$loggerName = 'exceptions'; $loggerFile = __DIR__ . '/exceptions.log'; $errorReporting = E_ALL ^ E_NOTICE; $showErrorInfo = true; (new Wilon\Exception\Handler) ->setLogger($loggerName, $loggerFile) ->bootstrap($errorReporting, $showErrorInfo);

Funtion Desc

setLogger ( string $loggerName, string $loggerFile), (*7)

Set Monolog, (*8)

  • string $loggerName, (*9)

    $logger = new Logger($loggerName);, (*10)

  • string $loggerFile, (*11)

    $logger->pushHandler(new StreamHandler($loggerFile, Logger::WARNING));, (*12)

bootstrap ( [ int $level [, boolean $show] ), (*13)

Sets which PHP errors are reported, (*14)

  • int $level, (*15)

    The new error_reporting level., (*16)

  • string $show, (*17)

    If is true, show debug., (*18)

The Versions

27/09 2017

dev-master

9999999-dev https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

27/09 2017

0.2.3

0.2.3.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

27/09 2017

5.3.9.x-dev

5.3.9.9999999-dev https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

27/09 2017

0.1.3

0.1.3.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

14/08 2017

0.2.2

0.2.2.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

14/08 2017

0.1.2

0.1.2.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

14/08 2017

0.1.1

0.1.1.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception

14/08 2017

0.2.1

0.2.1.0 https://wilon.github.io

Better exception output & write log.

  Sources   Download

MIT

The Requires

 

php exception