# LogCellRenderer

> Renders the typed cells of the logs grid for the Log debug panel.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Log](/docs/extensions/debug-core/reference/panel/log/index.md) › LogCellRenderer

| final class | `PHPForge\Debug\Panel\Log\LogCellRenderer` |
| --- | --- |
| Source | [`src/Panel/Log/LogCellRenderer.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Log/LogCellRenderer.php#L28) |

Renders the typed cells of the logs grid for the Log debug panel.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`buildRowOptions()`](#method-buildRowOptions) static | Builds the GridView `rowOptions` array for the row: anchor id (`log-{N}`) and severity-driven CSS class. | `LogCellRenderer` |
| [`renderCategoryCell()`](#method-renderCategoryCell) static | Renders the category as the shared [`Fqcn::renderLabel()`](/docs/extensions/debug-core/reference/helper/fqcn/index.md#method-renderLabel) two-tone label. | `LogCellRenderer` |
| [`renderLevelCell()`](#method-renderLevelCell) static | Renders the level name as a vocabulary-tinted chip (`error`, `warning`, `info`, `trace`, `profile`). | `LogCellRenderer` |
| [`renderMessageCell()`](#method-renderMessageCell) static | Renders the message cell, followed by the optional context disclosure and the optional trace list. | `LogCellRenderer` |
| [`renderTimeCell()`](#method-renderTimeCell) static | Renders the capture time as `H:i:s.mmm`, derived from the row's millisecond timestamp. | `LogCellRenderer` |
| [`renderTimeSincePreviousCell()`](#method-renderTimeSincePreviousCell) static | Renders the time-since-previous cell with the prev/next anchor navigation buttons. | `LogCellRenderer` |

## Method details

### buildRowOptions() <span id="method-buildRowOptions"></span>

```php
public static function buildRowOptions(PHPForge\Debug\Panel\Log\LogRow $row): array<string, mixed>
```

Builds the GridView `rowOptions` array for the row: anchor id (`log-{N}`) and severity-driven CSS class.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |

**Returns**

`array<string, mixed>`: Attribute map with `id` and (optionally) `class` keys.

### renderCategoryCell() <span id="method-renderCategoryCell"></span>

```php
public static function renderCategoryCell(PHPForge\Debug\Panel\Log\LogRow $row): string
```

Renders the category as the shared [`Fqcn::renderLabel()`](/docs/extensions/debug-core/reference/helper/fqcn/index.md#method-renderLabel) two-tone label.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |

**Returns**

`string`

### renderLevelCell() <span id="method-renderLevelCell"></span>

```php
public static function renderLevelCell(PHPForge\Debug\Panel\Log\LogRow $row): string
```

Renders the level name as a vocabulary-tinted chip (`error`, `warning`, `info`, `trace`, `profile`).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |

**Returns**

`string`

### renderMessageCell() <span id="method-renderMessageCell"></span>

```php
public static function renderMessageCell(PHPForge\Debug\Panel\Log\LogRow $row, Closure(array<string, mixed>): string $traceLine): string
```

Renders the message cell, followed by the optional context disclosure and the optional trace list.

SQL renders highlighted, a `print_r()` or `var_export()` dump as a [`DumpTreeRenderer`](/docs/extensions/debug-core/reference/panel/log/dumptreerenderer/index.md) tree, and any other
message as escaped text; the message is escaped once.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |
| `$traceLine` | [`Closure`](https://www.php.net/manual/en/class.closure.php)`(array<string, mixed>): string` | Renders one backtrace frame as a link line. |

**Returns**

`string`

### renderTimeCell() <span id="method-renderTimeCell"></span>

```php
public static function renderTimeCell(PHPForge\Debug\Panel\Log\LogRow $row): string
```

Renders the capture time as `H:i:s.mmm`, derived from the row's millisecond timestamp.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |

**Returns**

`string`

### renderTimeSincePreviousCell() <span id="method-renderTimeSincePreviousCell"></span>

```php
public static function renderTimeSincePreviousCell(PHPForge\Debug\Panel\Log\LogRow $row): string
```

Renders the time-since-previous cell with the prev/next anchor navigation buttons.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`LogRow`](/docs/extensions/debug-core/reference/panel/log/logrow/index.md) |  |

**Returns**

`string`