@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
84 lines • 2.69 kB
TypeScript
import { Logger } from './logger';
import { LogLevel, LoggerConfig } from './types';
/**
* Global Logger Manager
* Manages logger instances across different domains with unified configuration
*/
export declare class LoggerManager {
private static instance;
private globalConfig;
private loggers;
private constructor();
/**
* Get the singleton instance of LoggerManager
*/
static getInstance(): LoggerManager;
/**
* Set global logger configuration
* This affects all new logger instances created after this call
*/
setGlobalConfig(config: Partial<LoggerConfig>): void;
/**
* Get global logger configuration
*/
getGlobalConfig(): LoggerConfig;
/**
* Get logger for a specific domain/component
* Creates and caches logger instances per domain
*/
getLogger(domain: string, additionalFields?: Record<string, any>): Logger;
/**
* Get logger for a specific domain with component information
*/
getComponentLogger(domain: string, component: string, additionalFields?: Record<string, any>): Logger;
/**
* Clear all cached loggers
* Useful when you want to force recreation with new configuration
*/
clearCache(): void;
/**
* Get all cached logger domains
*/
getCachedDomains(): string[];
/**
* Set log level for all existing and future loggers
*/
setLogLevel(level: LogLevel): void;
/**
* Enable or disable caller information for all loggers
*/
setCallerEnabled(enabled: boolean): void;
/**
* Set JSON format for all loggers
*/
setJsonFormat(enabled: boolean): void;
}
declare const globalLoggerManager: LoggerManager;
/**
* Initialize global logger configuration
* Call this once at application startup
*/
export declare function initLogger(config: Partial<LoggerConfig>): void;
/**
* Get logger for a domain
* Convenience function to avoid accessing LoggerManager directly
*/
export declare function getDomainLogger(domain: string, additionalFields?: Record<string, any>): Logger;
/**
* Get logger for a specific component within a domain
*/
export declare function getComponentLogger(domain: string, component: string, additionalFields?: Record<string, any>): Logger;
/**
* Set global log level
*/
export declare function setGlobalLogLevel(level: LogLevel): void;
/**
* Enable or disable caller information globally
*/
export declare function setGlobalCallerEnabled(enabled: boolean): void;
/**
* Set JSON format globally
*/
export declare function setGlobalJsonFormat(enabled: boolean): void;
export { globalLoggerManager };
//# sourceMappingURL=manager.d.ts.map