Skip to content

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 DebugController

Methods

MethodReturnsDescription
disable(namespaces)voidDisable specific debug namespaces. Disabled namespaces take precedence over enabled ones when there's a conflict.
enable(namespaces)voidEnable specific debug namespaces. Note that explicitly disabled namespaces (prefixed with '-') will remain disabled.
get()string[]Get currently configured debug namespaces.
set(namespaces)voidSet debug namespaces, replacing all previous configurations.

Links to this page: