@noony-serverless/core
Version:
A Middy base framework compatible with Firebase and GCP Cloud Functions with TypeScript
42 lines • 1.3 kB
TypeScript
export interface LogOptions {
structuredData?: boolean;
[key: string]: boolean | string | number | object | undefined;
}
declare class Logger {
private logDataPool;
private isDebugEnabled;
private timestampCache;
private lastTimestamp;
constructor();
/**
* Performance optimized timestamp generation with caching
* Cache timestamps for up to 1 second to reduce Date object creation
*/
private getTimestamp;
/**
* Optimized log method with object pooling and lazy evaluation
*/
private log;
/**
* Performance optimized logging methods with level checks
*/
info(message: string, options?: LogOptions): void;
error(message: string, options?: LogOptions): void;
warn(message: string, options?: LogOptions): void;
debug(message: string, options?: LogOptions): void;
/**
* Performance monitoring method for internal framework use
*/
logPerformance(operation: string, duration: number, metadata?: Record<string, unknown>): void;
/**
* Get logger statistics for monitoring
*/
getStats(): {
poolSize: number;
maxPoolSize: number;
debugEnabled: boolean;
};
}
export declare const logger: Logger;
export { Logger };
//# sourceMappingURL=logger.d.ts.map