Skip to content
PHP Ecosystem
Explore

LogCounts

API reference › Debug Core › Panel › Log › LogCounts

final readonly classPHPForge\Debug\Panel\Log\LogCounts
Sourcesrc/Panel/Log/LogCounts.php

Typed view-model for the log-level totals shown in the detail view’s summary header.

PropertyTypeDescriptionDefined by
$errors readonly constructorintNumber of messages at LogLevel::ERROR.LogCounts
$info readonly constructorintNumber of messages at LogLevel::INFO.LogCounts
$total readonly constructorintTotal number of log messages captured for the request.LogCounts
$trace readonly constructorintNumber of messages at LogLevel::TRACE. Default: 0.LogCounts
$warnings readonly constructorintNumber of messages at LogLevel::WARNING.LogCounts
MethodDescriptionDefined by
__construct()Creates the log-level totals for the detail view.LogCounts
fromRows() staticBuilds log-level totals from the captured rows.LogCounts
hasErrors()Returns whether at least one error-level message was captured.LogCounts
hasInfo()Returns whether at least one info-level message was captured.LogCounts
hasTrace()Returns whether at least one trace-level message was captured.LogCounts
hasWarnings()Returns whether at least one warning-level message was captured.LogCounts
public function __construct(int $total, int $errors, int $warnings, int $info, int $trace = 0)

Creates the log-level totals for the detail view.

Parameters

ParameterTypeDescription
$totalint
$errorsint
$warningsint
$infoint
$traceint
public static function fromRows(list<PHPForge\Debug\Panel\Log\LogRow> $rows): self

Builds log-level totals from the captured rows.

Parameters

ParameterTypeDescription
$rowslist<LogRow>Captured log rows.

Returns

self

public function hasErrors(): bool

Returns whether at least one error-level message was captured.

Returns

bool

public function hasInfo(): bool

Returns whether at least one info-level message was captured.

Returns

bool

public function hasTrace(): bool

Returns whether at least one trace-level message was captured.

Returns

bool

public function hasWarnings(): bool

Returns whether at least one warning-level message was captured.

Returns

bool