LogSnapshot
API reference › Debug Core › Panel › Log › LogSnapshot
Canonical Log panel snapshot holding the captured rows in their typed form.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a log snapshot from captured rows. | LogSnapshot |
capture() static | Converts canonical logger tuples into typed rows, deriving the previous/next links and the inter-row deltas. | LogSnapshot |
entries() | Returns the captured log rows. | LogSnapshot |
fromArray() static | Narrows the persisted log payload into a typed snapshot. | LogSnapshot |
jsonSerialize() | Returns the panel snapshot for JSON serialization. | LogSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(list<PHPForge\Debug\Panel\Log\LogRow> $entries)Creates a log snapshot from captured rows.
Parameters
| Parameter | Type | Description |
|---|---|---|
$entries | list<LogRow> |
capture()
Section titled “capture() ”public static function capture(list<PHPForge\Debug\Panel\Log\LogTuple> $messages): selfConverts canonical logger tuples into typed rows, deriving the previous/next links and the inter-row deltas.
Parameters
| Parameter | Type | Description |
|---|---|---|
$messages | list<PHPForge\ | Logger tuples in capture order. |
Returns
self
entries()
Section titled “entries() ”public function entries(): list<PHPForge\Debug\Panel\Log\LogRow>Returns the captured log rows.
Returns
list<LogRow>: Captured rows in capture order.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows the persisted log payload into a typed snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted payload, expected to be an object carrying an entries list. |
$path | string | JSON path of the payload, used to report a malformed capture. |
Returns
self: Snapshot carrying the persisted log rows.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the panel snapshot for JSON serialization.
Returns
array<string, mixed>