@bernierllc/logging
Version:
A comprehensive logging package with Winston integration for audit and system logging
80 lines • 3.96 kB
TypeScript
export * from './types';
export * from './config/types';
export { LoggingError, type LoggingErrorCode, type LoggingErrorOptions } from './errors';
export { loadServiceLoggingConfiguration, loadServiceLoggingConfigurationWithSources, ServiceLoggingConfigurationLoader, DEFAULT_LOGGING_SERVICE_CONFIG, type ConfigurationSource } from './config/loadConfiguration';
export { ServiceLoggingManager, createServiceLoggingManager, getServiceLoggingManager, resetServiceLoggingManager, createConfiguredLogger } from './serviceLoggingManager';
export { CoreLoggerBridge, createCoreSystemLogger, logSystemWithCore, logErrorWithCore, logWarnWithCore, logInfoWithCore, logDebugWithCore } from './coreLoggerBridge';
export { createAuditLogger, logAudit, logAuditEntry } from './auditLogger';
export { createSystemLogger, logSystem, logError, logWarn, logInfo, logDebug, logSystemEntry } from './systemLogger';
export { default as winston } from 'winston';
export { createBrowserLogger } from './browserLogger';
/**
* Create configured logger with runtime configuration
* This replaces the old default logger instances
*/
export declare function createLogger(runtimeConfig?: Partial<import('./config/types').ServiceLoggingRuntimeConfig>): Promise<{
core: import("./mocks/coreLogger").Logger | undefined;
manager: import("./serviceLoggingManager").ServiceLoggingManager;
system: import("winston").Logger | undefined;
auditLogger: import("winston").Logger | undefined;
bridge: import("./coreLoggerBridge").CoreLoggerBridge | undefined;
error: (message: string, error?: Error, metadata?: Record<string, unknown>) => void;
warn: (message: string, metadata?: Record<string, unknown>) => void;
info: (message: string, metadata?: Record<string, unknown>) => void;
debug: (message: string, metadata?: Record<string, unknown>) => void;
audit: (entry: import("./types").AuditLogEntry) => void;
}>;
/**
* @deprecated Use createLogger() with runtime configuration instead
* Default audit logger instance - will be replaced by runtime configuration
*/
export declare const defaultAuditLogger: import("winston").Logger;
/**
* @deprecated Use createLogger() with runtime configuration instead
* Default system logger instance - will be replaced by runtime configuration
*/
export declare const defaultSystemLogger: import("winston").Logger;
/**
* @deprecated Use createLogger().audit() instead
* Convenience function to log audit events using default logger
*/
export declare function audit(entry: import('./types').AuditLogEntry): void;
/**
* @deprecated Use createLogger().system() instead
* Convenience function to log system events using default logger
*/
export declare function system(entry: import('./types').SystemLogEntry): void;
/**
* @deprecated Use createLogger() for configured logging instead
* Legacy convenience logger - will be replaced by runtime configuration
*/
export declare const logger: {
error: (message: string, error?: Error, metadata?: Record<string, unknown>) => void;
warn: (message: string, metadata?: Record<string, unknown>) => void;
info: (message: string, metadata?: Record<string, unknown>) => void;
debug: (message: string, metadata?: Record<string, unknown>) => void;
audit: (entry: import("./types").AuditLogEntry) => void;
};
/**
* Migration guide for upgrading to runtime configuration
*/
export declare const MIGRATION_GUIDE: {
/**
* Old way (deprecated):
* import { logger } from '@bernierllc/logging';
* logger.info('Hello world');
*
* New way (recommended):
* import { createLogger } from '@bernierllc/logging';
* const logger = await createLogger();
* logger.info('Hello world');
*
* Or with custom configuration:
* const logger = await createLogger({
* level: 'debug',
* system: { console: { enabled: true } }
* });
*/
example: string;
};
//# sourceMappingURL=index.d.ts.map