Debugger Architecture
The Debugger package follows a simple pipeline:
- boot the shared debugger instance
- initialize tab storage
- let framework components append structured messages into store cells
- replay those messages into DebugBar collectors during layout render
Runtime flow
1. Boot stage
Quantum\App\Stages\InitDebuggerStage runs in the web app boot pipeline and calls debugbar()->initStore().
In Quantum\App\Adapters\WebAppAdapter, that happens after helpers, environment, config, error handler, and HTTP initialization, but before modules are loaded.
2. Producers write into the store
Several framework components write diagnostics into the same store:
Quantum\Logger\Adapters\MessageAdapterwrites log messages intomessagesor a caller-provided tabQuantum\App\Traits\WebAppTrait::logDebugInfo()writes registered hooks intohooksQuantum\View\View::updateDebugger()rewrites theroutestab to include the resolved view file- mailer code routes failures into the
mailstab through logger helpers
Each write is appended as [$level => $data].
Store model
DebuggerStore keeps data in a private static array:
private static array $store = [];
Important consequences:
- all
DebuggerStoreinstances share the same data delete($key)clears a cell to an empty array instead of removing the keyflush()removes the entire store arrayget($key)returns[]when the key does not exist
Render model
Debugger::render() loops over the built-in tab names and calls createTab($tab) for each one.
That list is fixed to messages, queries, routes, hooks, and mails.
createTab():
- creates a
MessagesCollectorfor the tab if it does not already exist - fetches stored messages for that tab
- calls the collector method named by the stored level (
info,warning, and so on)
Because the level name is executed as a method call, the write side and the collector API must stay in sync.
It also means store-backed custom tab names are not replayed automatically. Writing to some other cell is only useful if you add your own render path around the package.
View-path merge behavior
The routes tab is not append-only.
Quantum\View\View::updateDebugger() reads the first existing info payload from routes, merges in:
['View' => request()->getCurrentModule() . '/Views/' . $viewFile]
and then clears and rewrites the tab.
So the final routes payload is a merged structure, not a chronological list of route-related events.