src/log/Logger.php
private static function resolveLogLocation(array &$context) {
        if (!key_exists('trace', $context))
            self::generateStackTrace($context);
        $trace = $context['trace'];

        foreach ($trace as $i => $frame) {                  // find the first frame with "file"
            if (isset($frame['file'])) {                    // skip internal PHP functions
                $context['file'] = $frame['file'];
                $context['line'] = $frame['line'];
                break;
            }
        }

        if (!key_exists('file', $context)) {
            $context['file'] = '(unknown)';
            $context['line'] = '(?)';
        }
    }
private static function resolveLogLocation(array &$context) {
        if (!key_exists('trace', $context))
            self::generateStackTrace($context);
        $trace = $context['trace'];

        foreach ($trace as $i => $frame) {                  // find the first frame with "file"
            if (isset($frame['file'])) {                    // skip internal PHP functions
                $context['file'] = $frame['file'];
                $context['line'] = $frame['line'];
                break;
            }
        }

        if (!key_exists('file', $context)) {
            $context['file'] = '(unknown)';
            $context['line'] = '(?)';
        }
    }
private static function resolveLogLocation ( array & $ context ) { if ( ! key_exists ( 'trace' , $ context ) ) self :: generateStackTrace ( $ context ) ; $ trace = $ context [ 'trace' ] ; foreach ( $ trace as $ i => $ frame ) { // find the first frame with "file" if ( isset ( $ frame [ 'file' ] ) ) { // skip internal PHP functions $ context [ 'file' ] = $ frame [ 'file' ] ; $ context [ 'line' ] = $ frame [ 'line' ] ; break ; } } if ( ! key_exists ( 'file' , $ context ) ) { $ context [ 'file' ] = '(unknown)' ; $ context [ 'line' ] = '(?)' ; } }
Resolve the location the logger was called from and store it in the log context under the keys "file" and "line".

@param  array $context - reference to the log context
Resolve the location the logger was called from and store it in the log context under the keys file and line .