@bernierllc/logging
Version:
A comprehensive logging package with Winston integration for audit and system logging
80 lines • 2.75 kB
TypeScript
import { Logger } from './mocks/coreLogger';
import { SystemLogEntry, SystemLoggerConfig } from './types';
/**
* Bridge between Winston-based system logger and core logger with runtime configuration
* This provides backward compatibility while enabling runtime configuration
*/
export declare class CoreLoggerBridge {
private coreLogger;
private isInitialized;
constructor(config?: SystemLoggerConfig);
/**
* Initialize the bridge with runtime configuration
* This should be called once at application startup
*/
initializeWithRuntimeConfig(): Promise<void>;
/**
* Convert Winston config to core logger config
*/
private createCoreLoggerFromWinstonConfig;
/**
* Map Winston log levels to core logger levels
*/
private mapWinstonLevelToCoreLevel;
/**
* Map core logger levels to Winston log levels
*/
private mapCoreLevelToWinstonLevel;
/**
* Parse size string to bytes
*/
private parseSizeToBytes;
/**
* Winston-compatible log method
*/
log(level: string, message: string, meta?: any): void;
/**
* Winston-compatible error method
*/
error(message: string, meta?: any): void;
/**
* Winston-compatible warn method
*/
warn(message: string, meta?: any): void;
/**
* Winston-compatible info method
*/
info(message: string, meta?: any): void;
/**
* Winston-compatible debug method
*/
debug(message: string, meta?: any): void;
/**
* Winston-compatible add method (no-op for compatibility)
*/
add(): void;
/**
* Get the underlying core logger
*/
getCoreLogger(): Logger;
/**
* Get logger configuration
*/
getConfig(): any;
}
/**
* Create a Winston-compatible logger using core logger with runtime configuration
*/
export declare function createCoreSystemLogger(config?: SystemLoggerConfig): Promise<CoreLoggerBridge>;
/**
* Log a system entry using core logger
*/
export declare function logSystemWithCore(bridge: CoreLoggerBridge, entry: SystemLogEntry): void;
/**
* Convenience functions for different log levels using core logger
*/
export declare function logErrorWithCore(bridge: CoreLoggerBridge, message: string, error?: Error, metadata?: Record<string, unknown>): void;
export declare function logWarnWithCore(bridge: CoreLoggerBridge, message: string, metadata?: Record<string, unknown>): void;
export declare function logInfoWithCore(bridge: CoreLoggerBridge, message: string, metadata?: Record<string, unknown>): void;
export declare function logDebugWithCore(bridge: CoreLoggerBridge, message: string, metadata?: Record<string, unknown>): void;
//# sourceMappingURL=coreLoggerBridge.d.ts.map