Log Cache miss, gets info it needs by backtrace if needed.

@since 7.5

@param array $arguments
@param int $traceOffset
190792
public function logCacheMiss(array $arguments = [], int $traceOffset = 2): void
    {
        ++$this->stats['miss'];
        if (!$this->logCalls) {
            return;
        }

        $trace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 8 + $traceOffset);
        $this->collectCacheCallData(
            $trace[$traceOffset - 1]['class'] . '::' . $trace[$traceOffset - 1]['function'],
            $arguments,
            \array_slice($trace, $traceOffset),
            'miss'
        );
    }
1156207
public void setTraces(java.util.Collection<Trace> traces) {
        if (traces == null) {
            this.traces = null;
            return;
        }

        this.traces = new java.util.ArrayList<Trace>(traces);
    }
23
public static function trace($trace = null, $addObject = false)
    {
        if (!self::isDebug()) {
            return false;
        }

        $_this = self::i();

        $trace = $trace ? $trace : debug_backtrace($addObject);
        unset($trace[0]);

        $result = $_this->convertTrace($trace, $addObject);

        return $_this->dump($result, '! backtrace !');
    }
248005
function(callback) {
    this._cacheBackboneTraces();
    for (var i=0; i < this._cachedTraces.length; ++i) {
      callback(this._cachedTraces[i]);
    }
  }
357853
private void traceJndiReturn(String methodname, long duration, Object... objs) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms]", objs);
        }
    }
945897
public static function backtrace($trace = null)
	{
		$trace or $trace = debug_backtrace();

		if (\Fuel::$is_cli) {
			// Special case for CLI since the var_dump of a backtrace is of little use.
			$str = '';
			foreach ($trace as $i => $frame)
			{
				$line = "#$i\t";

				if ( ! isset($frame['file']))
				{
					$line .= "[internal function]";
				}
				else
				{
					$line .= $frame['file'] . ":" . $frame['line'];
				}

				$line .= "\t";

				if (isset($frame['function']))
				{
					if (isset($frame['class']))
					{
						$line .= $frame['class'] . '::';
					}

					$line .= $frame['function'] . "()";
				}

				$str .= $line . "\n";

			}

			return $str;
		}
		else
		{
			return static::dump($trace);
		}
	}
466966
public function debug($message, $args=array())
    {
        $backtrace        = debug_backtrace();
        $args['FILENAME'] = $backtrace[0]['file'];
        $args['LINENO']   = $backtrace[0]['line'];
        $this->log($message, $args, 'LOG_DEBUG');

    }
361429
protected static function get_calling_module_from_trace($backtrace)
    {
        if (!isset($backtrace[1]['file'])) {
            return null;
        }

        $callingfile = realpath($backtrace[1]['file']);

        return ModuleLoader::inst()->getManifest()->getModuleByPath($callingfile);
    }
1332384
public static function dWithTrace(array $trace) {
		#clear all active buffers
		while(ob_get_level())
			ob_end_clean();

		if(!headers_sent())
			http_response_code(520);

		if(static::$format === 'html')
			echo '<pre>';
		foreach(array_slice(func_get_args(), 1) as $arg)
			var_dump($arg);
		if(static::$format === 'html')
			echo '</pre>';

		die(static::getReport($trace));
	}
659758
public function backward($args, $total, array $callableArgs = [])
    {
        $total = $this->computeTotalCount($total, $callableArgs);

        $args = $this->protectArgs($args);
        $limit = $args['last'];
        $offset = \max(0, $this->connectionBuilder->getOffsetWithDefault($args['before'], $total) - $limit);

        $entities = \call_user_func($this->fetcher, $offset, $limit);

        return $this->handleEntities($entities, function ($entities) use ($args, $offset, $total) {
            return $this->connectionBuilder->connectionFromArraySlice($entities, $args, [
                'sliceStart' => $offset,
                'arrayLength' => $total,
            ]);
        });
    }
406438
public static void debug(String format, Object... arguments) {
		debug(LogFactory.get(CallerUtil.getCallerCaller()), format, arguments);
	}
268406
private function collectCacheCallData($method, array $arguments, array $trimmedBacktrace, string $type): void
    {
        // simplest/fastests hash possible to identify if we have already collected this before to save on memory use
        $callHash = \hash('adler32', $method . \serialize($arguments));
        if (empty($this->calls[$callHash])) {
            $this->calls[$callHash] = [
                'method' => $method,
                'arguments' => $arguments,
                'stats' => [
                    'uncached' => 0,
                    'miss' => 0,
                    'hit' => 0,
                    'memory' => 0,
                ],
                'traces' => [],
            ];
        }
        ++$this->calls[$callHash]['stats'][$type];

        $trace = $this->getSimpleCallTrace($trimmedBacktrace);
        $traceHash = \hash('adler32', \implode($trace));
        if (empty($this->calls[$callHash]['traces'][$traceHash])) {
            $this->calls[$callHash]['traces'][$traceHash] = [
                'trace' => $trace,
                'count' => 0,
            ];
        }
        ++$this->calls[$callHash]['traces'][$traceHash]['count'];
    }
585129
public void trace(String loggerFqcn, Object message, Object[] params, Throwable t) {
        doLog(Level.TRACE, loggerFqcn, message, params, t);
    }
186620
public function traceLog(string $key = null, $message = null)
    {
        if ($this->trace_log_enabled) {
            if (is_array($message) || is_object($message)) {
                $text = print_r($message, true);
            } elseif ($message === null) {
                $text = "[null]";
            } elseif ($message === false) {
                $text = "[false]";
            } elseif ($message === true) {
                $text = "[true]";
            } else {
                $text = $message;
            }
            error_log("=== " . ($key !== null ? "$key: " : '') . $text);
        }

        if ($key === null) {
            if ($this->trace_log_buffer === null) {
                $this->trace_log_buffer = array();
            }
            if (array_key_exists(self::MESSAGES_STACK, $this->trace_log_buffer)) {
                $this->trace_log_buffer[self::MESSAGES_STACK][] = $message;
            } else {
                $this->trace_log_buffer[self::MESSAGES_STACK] = array($message);
            }
        } else {
            $this->trace_log_buffer[$key] = $message;
        }
    }
869482
public void setTraces(Trace... traces) {
        this.traces.clear();
        for (Trace trace : traces) {
            if (!trace.addReplacements(this.traces)) {
                this.traces.add(trace);
            }
        }
    }
276647
private static function generateStackTrace(array &$context) {
        if (!key_exists('trace', $context)) {
            $trace = DebugHelper::fixTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), __FILE__, __LINE__);

            foreach ($trace as $i => $frame) {
                if (!isset($frame['class']) || $frame['class']!=__CLASS__)      // remove non-logger frames
                    break;
                unset($trace[$i]);
            }
            $context['trace'] = \array_values($trace);
        }
    }
410305
@Override
    public void trace(String format, Object arg) {
        if (logger.isTraceEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.trace(ft.getMessage(), ft.getThrowable());
        }
    }