UNPKG

unnbound-logger-sdk

Version:

A structured logging library with TypeScript support using Pino. Provides consistent, well-typed logging with automatic logId, workflowId, traceId, and deploymentId tracking across operational contexts.

35 lines (34 loc) 1.36 kB
/** * Generates the current timestamp in ISO format * @returns ISO timestamp string */ export declare function generateTimestamp(): string; /** * Gets or creates a trace ID for a workflow * @param workflowId - The workflow ID to get a trace ID for * @returns A trace ID associated with the workflow */ export declare function getTraceId(workflowId: string): string; /** * Clears a trace ID from the map * @param workflowId - The workflow ID to clear */ export declare function clearTraceId(workflowId: string): void; /** * Filters an object of headers, returning a new object with only the allowed headers. * @param headers The original headers object. * @returns A new object containing only the headers from the allow-list. */ export declare function filterHeaders(headers: Record<string, any>): Record<string, string>; /** * Safely parses JSON strings, returning the original data if parsing fails or if it's not a string. * @param data The data to potentially parse as JSON. * @returns Parsed JSON object or the original data. */ export declare function safeJsonParse(data: any): any; /** * Normalizes IP addresses by removing IPv6 mapping prefix for IPv4 addresses. * @param ip The IP address to normalize. * @returns Normalized IP address string. */ export declare function normalizeIp(ip: string | undefined): string | undefined;