Debug
Debug controls guarded diagnostic messages. Logging is disabled by default; Debug.error() always writes to the console. Enabling debug mode does not add tracing to operations that have no logging calls.
Enable diagnostics
import { Hygular } from '@hygular/core';
const app = new Hygular({ debug: true });
API
| Member | Behavior |
|---|---|
enable() | Enable guarded messages. |
disable() | Disable guarded messages. |
set(value) | Convert the value to a boolean and set the debug flag. |
isEnabled | Read the current boolean flag. |
log(...args) | Log when enabled. |
warn(...args) | Warn when enabled. |
error(...args) | Log an error regardless of the flag. |
group(label) | Open a console group when enabled. |
groupEnd() | Close a console group when enabled. |
Debug state is shared across the module. Disposing a Hygular instance does not reset it, and debug: false on another instance does not disable an already enabled flag. Call Debug.disable() explicitly when needed.
The flag does not suppress direct console calls elsewhere in the application or runtime.