public function setContext($context = 'development')
    {

        switch ($context) {
            case 'production':
                break;

            case 'development':
                error_reporting(-1);              // Report all type of errors
                ini_set('display_errors', 1);     // Display all errors
                ini_set('output_buffering', 0);   // Do not buffer output

                set_exception_handler(function ($exception) {
                    echo "Anax: Uncaught exception: <p>" .
                        $exception->getMessage() . "</p><pre>" .
                        $exception->getTraceAsString() . "</pre>";
                });
                break;

            case 'debug':
                break;

            default:
                throw new \Exception('Unknown context.');
                break;
        }

        $this->context = $context;
        return $this;
    }
public function setContext($context = 'development')
    {

        switch ($context) {
            case 'production':
                break;

            case 'development':
                error_reporting(-1);              // Report all type of errors
                ini_set('display_errors', 1);     // Display all errors
                ini_set('output_buffering', 0);   // Do not buffer output

                set_exception_handler(function ($exception) {
                    echo "Anax: Uncaught exception: <p>" .
                        $exception->getMessage() . "</p><pre>" .
                        $exception->getTraceAsString() . "</pre>";
                });
                break;

            case 'debug':
                break;

            default:
                throw new \Exception('Unknown context.');
                break;
        }

        $this->context = $context;
        return $this;
    }
public function setContext ( $ context = 'development' ) { switch ( $ context ) { case 'production' : break ; case 'development' : error_reporting ( - 1 ) ; // Report all type of errors ini_set ( 'display_errors' , 1 ) ; // Display all errors ini_set ( 'output_buffering' , 0 ) ; // Do not buffer output set_exception_handler ( function ( $ exception ) { echo "Anax: Uncaught exception: <p>" . $ exception -> getMessage ( ) . "</p><pre>" . $ exception -> getTraceAsString ( ) . "</pre>" ; } ) ; break ; case 'debug' : break ; default : throw new \ Exception ( 'Unknown context.' ) ; break ; } $ this -> context = $ context ; return $ this ; }
Init the logger depending on its context production, development or debug.

@param string $context as production, development or debug, default is development
@return $this
Init the logger depending on its context production development or debug .