DebugController
Controls debug output by managing debug namespaces. Exposed globally as window.DEBUG.
Debug settings persist across plugin reloads in localStorage.
Import:
import type { DebugController } from 'obsidian-dev-utils/debug-controller';Example:
- `lorem:*` matches all submodules of 'lorem'- `*:ipsum` matches all plugins' `ipsum` submodules- `*` matches everything
Special syntax:- Namespaces prefixed with '-' are explicitly disabled- Multiple namespaces can be combined with commas: `lorem,-lorem:ipsum,dolor:*`Signature:
export interface DebugControllerMethods
| Method | Returns | Description |
|---|---|---|
| disable(namespaces) | void | Disable specific debug namespaces. Disabled namespaces take precedence over enabled ones when there's a conflict. |
| enable(namespaces) | void | Enable specific debug namespaces. Note that explicitly disabled namespaces (prefixed with '-') will remain disabled. |
| get() | string[] | Get currently configured debug namespaces. |
| set(namespaces) | void | Set debug namespaces, replacing all previous configurations. |
Links to this page: