import type { ILogger, LoggerModes } from './types.js'; import { ProxyLogger } from './proxy.js'; export declare class LoggersManager { /** Storage for instances created by this manager */ private readonly _managed; /** Storage for all attached instances. */ private readonly _all; /** Current main mode. */ private _mode; /** Additionally attached logger destinations (e.g. for analytics) */ private readonly _destinations; get mode(): LoggerModes; /** Creates and attaches an logger instance created from the current mode */ create(name: string | undefined, mode?: undefined | LoggerModes): ILogger; /** Attaches existing instance, optionally adds name prefix to it. * * Useful when it's needed to enable/disable independent logger when this manager's mode changes. * * @returns - The attached logger instance wrapped in a ProxyLogger. */ attach(instance: ILogger, name?: string): ProxyLogger; /** * Adds a destination to the logger manager. * * This is useful for analytics or other purposes where you want to log to multiple destinations. * * @param target - Target logger instance that will recieve all logs disregarding current active mode. * @param name - An optional name for the destination (prepended to every log message). * @returns - A function to remove the destination. */ addDestination(target: ILogger, name?: string): () => void; /** * Sets the current mode if changed, for all attached instances. * * All internally created loggers implementation will be overridden with a new implementation according to the new mode. * * The rest just attached loggers will be just enabled/disabled based on input mode. * */ setMode(mode: LoggerModes | null | undefined): void; recognize(instance: ILogger): ProxyLogger | null; /** Detaches instance so it won't be affected by setting mode later on, optionally disables it */ detach(instance: ILogger, terminate?: boolean): boolean; private _updateAll; private _findInstance; private _createImplementation; expose(): { createLogger: (name: string | undefined, mode?: undefined | LoggerModes) => ILogger; detachLogger: (instance: ILogger, terminate?: boolean) => boolean; setMode: (mode: LoggerModes | null | undefined) => void; getMode: () => LoggerModes; logger: ILogger; }; }