logs-interceptor
Version:
High-performance, production-ready log interceptor for Node.js applications with Loki integration. Built with Clean Architecture principles. Supports Node.js, Browser, and Node-RED.
19 lines • 849 B
TypeScript
import { IContextService } from '../../domain/services/IContextService';
export interface ContextServiceConfig {
readonly appName: string;
readonly version: string;
readonly environment: string;
readonly labels?: Record<string, string>;
readonly dynamicLabels?: Record<string, () => string | number>;
}
export declare class ContextService implements IContextService {
private readonly config;
private readonly asyncStorage;
constructor(config: ContextServiceConfig);
getContext(): Record<string, unknown>;
getDynamicLabels(): Record<string, string>;
getMetadata(): Record<string, unknown>;
runWithContext<T>(context: Record<string, unknown>, fn: () => T): T;
runWithContextAsync<T>(context: Record<string, unknown>, fn: () => Promise<T>): Promise<T>;
}
//# sourceMappingURL=ContextService.d.ts.map