final static function computeMessage(\Exception $e, $styles = array(),
                                         $additionalLines = array())
    {
        if (!$styles) {
            $styles = static::$messageConfigs['default'];
        }

        $trace = $e->getTraceAsString();
        $trace = explode("\n", $trace);
        foreach ($trace as $key => $value) {
            $trace[$key] = sprintf($styles['simpleLine'],
                preg_replace('/#[0-9]*\s*/u', '', $value));
        }
        $file = sprintf($styles['simpleLine'], $e->getFile() . ' (' . $e->getLine() . ')');

        $lines[] = sprintf($styles['title'], get_class($e));
        $lines[] = '';
        $lines[] = sprintf($styles['line'], 'Message', print_r($e->getMessage(), true));
        $lines[] = sprintf($styles['line'], 'Code', $e->getCode());
        $lines = array_merge($lines, $additionalLines, array($file), $trace);
        $lines[] = '';
        return implode("\n", $lines);
    }
final static function computeMessage(\Exception $e, $styles = array(),
                                         $additionalLines = array())
    {
        if (!$styles) {
            $styles = static::$messageConfigs['default'];
        }

        $trace = $e->getTraceAsString();
        $trace = explode("\n", $trace);
        foreach ($trace as $key => $value) {
            $trace[$key] = sprintf($styles['simpleLine'],
                preg_replace('/#[0-9]*\s*/u', '', $value));
        }
        $file = sprintf($styles['simpleLine'], $e->getFile() . ' (' . $e->getLine() . ')');

        $lines[] = sprintf($styles['title'], get_class($e));
        $lines[] = '';
        $lines[] = sprintf($styles['line'], 'Message', print_r($e->getMessage(), true));
        $lines[] = sprintf($styles['line'], 'Code', $e->getCode());
        $lines = array_merge($lines, $additionalLines, array($file), $trace);
        $lines[] = '';
        return implode("\n", $lines);
    }
final static function computeMessage ( \ Exception $ e , $ styles = array ( ) , $ additionalLines = array ( ) ) { if ( ! $ styles ) { $ styles = static :: $ messageConfigs [ 'default' ] ; } $ trace = $ e -> getTraceAsString ( ) ; $ trace = explode ( "\n" , $ trace ) ; foreach ( $ trace as $ key => $ value ) { $ trace [ $ key ] = sprintf ( $ styles [ 'simpleLine' ] , preg_replace ( '/#[0-9]*\s*/u' , '' , $ value ) ) ; } $ file = sprintf ( $ styles [ 'simpleLine' ] , $ e -> getFile ( ) . ' (' . $ e -> getLine ( ) . ')' ) ; $ lines [ ] = sprintf ( $ styles [ 'title' ] , get_class ( $ e ) ) ; $ lines [ ] = '' ; $ lines [ ] = sprintf ( $ styles [ 'line' ] , 'Message' , print_r ( $ e -> getMessage ( ) , true ) ) ; $ lines [ ] = sprintf ( $ styles [ 'line' ] , 'Code' , $ e -> getCode ( ) ) ; $ lines = array_merge ( $ lines , $ additionalLines , array ( $ file ) , $ trace ) ; $ lines [ ] = '' ; return implode ( "\n" , $ lines ) ; }
Computes a human readable log message from any exception
@return string
Computes a human readable log message from any exception