> For the complete documentation index, see [llms.txt](https://quantumphp.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quantumphp.gitbook.io/docs/packages/debugger/usage.md).

# Usage

Most applications use the Debugger package indirectly through Quantum's web stack, but the underlying API is small enough to use directly.

## Basic logging

```php
debugbar()->addToStoreCell('messages', 'info', 'Booted module');
debugbar()->addToStoreCell('messages', 'warning', 'Slow downstream response');
```

Those entries are rendered into the `messages` tab when `app.debug` is enabled.

## Writing to a specific tab

Quantum uses named tabs such as `queries`, `routes`, `hooks`, and `mails`.

```php
use Quantum\Debugger\Debugger;

debugbar()->addToStoreCell(Debugger::MAILS, 'warning', 'SMTP handshake failed');
```

You can also route logger output into a tab by passing a `tab` context value to the framework's message logger path.

Stick to the built-in tab constants for normal usage. `render()` only replays `messages`, `queries`, `routes`, `hooks`, and `mails` from the store.

## Rendering in a layout

```php
<?= debugbar()->render() ?>
```

When debugging is disabled, this returns an empty string.

When debugging is enabled, it returns both the renderer head assets and the toolbar markup, so it should only be emitted once per page.

If you call `render()` more than once on the same shared debugger instance, stored messages are replayed again and can appear duplicated in the toolbar.

## Custom collectors

`Debugger::__construct()` accepts an optional collector array.

If you pass a non-empty collector list, Quantum uses that list instead of the package defaults.

That means custom construction replaces the default collector set; it does not append to it automatically.

## Practical caveats

* Run `install:debugbar` before expecting the toolbar assets to load in the browser.
* `resetStore()` clears all tabs for the shared store.
* `clearStoreCell($cell)` empties a tab but keeps the tab key available.
* Because the helper is DI-backed, mid-request config changes do not rebuild the debugger instance automatically.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://quantumphp.gitbook.io/docs/packages/debugger/usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
