This document describes utilities designed for development and debugging purposes. They control logging behavior and allow you to enhance error stack traces with additional debugging information.
import { setLoggerMode, setDebugErrorStackMode } from 'saborter/dev';Sets the global logging mode for the application. This function updates internal flags that determine whether logging is enabled and whether informational logs should be suppressed.
Parameters:
enabled: boolean- Iftrue, logging is globally enabled; iffalse, logging is disabled.options?: Object- Additional configuration.skipInfo?: boolean(defaultfalse): Iftrue,info-level logs are skipped even when logging is enabled. Iffalse, all log levels are allowed.
Example:
// Enable logging but skip info messages
setLoggerMode(true, { skipInfo: true });
// Disable all logging
setLoggerMode(false);Enables or disables the inclusion of debug information in error stack traces for classes that extend ExtendedStackError.
Parameters:
enabled: boolean- Iftrue, debug stack expansion is enabled; iffalse, it is disabled. The default isfalse.
Example:
// Enable debug stack information
setDebugErrorStackMode(true);