src/Dev/Backtrace.php
public static function filter_backtrace($bt, $ignoredFunctions = null)
    {
        $defaultIgnoredFunctions = array(
            'SilverStripe\\Logging\\Log::log',
            'SilverStripe\\Dev\\Backtrace::backtrace',
            'SilverStripe\\Dev\\Backtrace::filtered_backtrace',
            'Zend_Log_Writer_Abstract->write',
            'Zend_Log->log',
            'Zend_Log->__call',
            'Zend_Log->err',
            'SilverStripe\\Dev\\DebugView->writeTrace',
            'SilverStripe\\Dev\\CliDebugView->writeTrace',
            'SilverStripe\\Dev\\Debug::emailError',
            'SilverStripe\\Dev\\Debug::warningHandler',
            'SilverStripe\\Dev\\Debug::noticeHandler',
            'SilverStripe\\Dev\\Debug::fatalHandler',
            'errorHandler',
            'SilverStripe\\Dev\\Debug::showError',
            'SilverStripe\\Dev\\Debug::backtrace',
            'exceptionHandler'
        );

        if ($ignoredFunctions) {
            foreach ($ignoredFunctions as $ignoredFunction) {
                $defaultIgnoredFunctions[] = $ignoredFunction;
            }
        }

        while ($bt && in_array(self::full_func_name($bt[0]), $defaultIgnoredFunctions)) {
            array_shift($bt);
        }

        $ignoredArgs = static::config()->get('ignore_function_args');

        // Filter out arguments
        foreach ($bt as $i => $frame) {
            $match = false;
            if (!empty($bt[$i]['class'])) {
                foreach ($ignoredArgs as $fnSpec) {
                    if (is_array($fnSpec) &&
                        ('*' == $fnSpec[0] || $bt[$i]['class'] == $fnSpec[0]) &&
                        $bt[$i]['function'] == $fnSpec[1]
                    ) {
                        $match = true;
                    }
                }
            } else {
                if (in_array($bt[$i]['function'], $ignoredArgs)) {
                    $match = true;
                }
            }
            if ($match) {
                foreach ($bt[$i]['args'] as $j => $arg) {
                    $bt[$i]['args'][$j] = '<filtered>';
                }
            }
        }

        return $bt;
    }
public static function filter_backtrace($bt, $ignoredFunctions = null)
    {
        $defaultIgnoredFunctions = array(
            'SilverStripe\\Logging\\Log::log',
            'SilverStripe\\Dev\\Backtrace::backtrace',
            'SilverStripe\\Dev\\Backtrace::filtered_backtrace',
            'Zend_Log_Writer_Abstract->write',
            'Zend_Log->log',
            'Zend_Log->__call',
            'Zend_Log->err',
            'SilverStripe\\Dev\\DebugView->writeTrace',
            'SilverStripe\\Dev\\CliDebugView->writeTrace',
            'SilverStripe\\Dev\\Debug::emailError',
            'SilverStripe\\Dev\\Debug::warningHandler',
            'SilverStripe\\Dev\\Debug::noticeHandler',
            'SilverStripe\\Dev\\Debug::fatalHandler',
            'errorHandler',
            'SilverStripe\\Dev\\Debug::showError',
            'SilverStripe\\Dev\\Debug::backtrace',
            'exceptionHandler'
        );

        if ($ignoredFunctions) {
            foreach ($ignoredFunctions as $ignoredFunction) {
                $defaultIgnoredFunctions[] = $ignoredFunction;
            }
        }

        while ($bt && in_array(self::full_func_name($bt[0]), $defaultIgnoredFunctions)) {
            array_shift($bt);
        }

        $ignoredArgs = static::config()->get('ignore_function_args');

        // Filter out arguments
        foreach ($bt as $i => $frame) {
            $match = false;
            if (!empty($bt[$i]['class'])) {
                foreach ($ignoredArgs as $fnSpec) {
                    if (is_array($fnSpec) &&
                        ('*' == $fnSpec[0] || $bt[$i]['class'] == $fnSpec[0]) &&
                        $bt[$i]['function'] == $fnSpec[1]
                    ) {
                        $match = true;
                    }
                }
            } else {
                if (in_array($bt[$i]['function'], $ignoredArgs)) {
                    $match = true;
                }
            }
            if ($match) {
                foreach ($bt[$i]['args'] as $j => $arg) {
                    $bt[$i]['args'][$j] = '<filtered>';
                }
            }
        }

        return $bt;
    }
public static function filter_backtrace ( $ bt , $ ignoredFunctions = null ) { $ defaultIgnoredFunctions = array ( 'SilverStripe\\Logging\\Log::log' , 'SilverStripe\\Dev\\Backtrace::backtrace' , 'SilverStripe\\Dev\\Backtrace::filtered_backtrace' , 'Zend_Log_Writer_Abstract->write' , 'Zend_Log->log' , 'Zend_Log->__call' , 'Zend_Log->err' , 'SilverStripe\\Dev\\DebugView->writeTrace' , 'SilverStripe\\Dev\\CliDebugView->writeTrace' , 'SilverStripe\\Dev\\Debug::emailError' , 'SilverStripe\\Dev\\Debug::warningHandler' , 'SilverStripe\\Dev\\Debug::noticeHandler' , 'SilverStripe\\Dev\\Debug::fatalHandler' , 'errorHandler' , 'SilverStripe\\Dev\\Debug::showError' , 'SilverStripe\\Dev\\Debug::backtrace' , 'exceptionHandler' ) ; if ( $ ignoredFunctions ) { foreach ( $ ignoredFunctions as $ ignoredFunction ) { $ defaultIgnoredFunctions [ ] = $ ignoredFunction ; } } while ( $ bt && in_array ( self :: full_func_name ( $ bt [ 0 ] ) , $ defaultIgnoredFunctions ) ) { array_shift ( $ bt ) ; } $ ignoredArgs = static :: config ( ) -> get ( 'ignore_function_args' ) ; // Filter out arguments foreach ( $ bt as $ i => $ frame ) { $ match = false ; if ( ! empty ( $ bt [ $ i ] [ 'class' ] ) ) { foreach ( $ ignoredArgs as $ fnSpec ) { if ( is_array ( $ fnSpec ) && ( '*' == $ fnSpec [ 0 ] || $ bt [ $ i ] [ 'class' ] == $ fnSpec [ 0 ] ) && $ bt [ $ i ] [ 'function' ] == $ fnSpec [ 1 ] ) { $ match = true ; } } } else { if ( in_array ( $ bt [ $ i ] [ 'function' ] , $ ignoredArgs ) ) { $ match = true ; } } if ( $ match ) { foreach ( $ bt [ $ i ] [ 'args' ] as $ j => $ arg ) { $ bt [ $ i ] [ 'args' ] [ $ j ] = '<filtered>' ; } } } return $ bt ; }
Filter a backtrace so that it doesn't show the calls to the
debugging system, which is useless information.

@param array $bt Backtrace to filter
@param null|array $ignoredFunctions List of extra functions to filter out
@return array
Filter a backtrace so that it doesn t show the calls to the debugging system which is useless information .