/** * Structured logging helpers (console + optional AsyncLocalStorage request IDs). */ export type LogLevel = 'debug' | 'info' | 'warn' | 'error'; /** * Logger interface. */ export interface Logger { debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, context?: Record): void; } /** * Configure global logging settings. * * @param level - Minimum log level to output * @param format - Output format ('console' for human-readable, 'json' for structured) */ export declare function configureLogging(level?: LogLevel, format?: 'console' | 'json'): void; /** * Get the current log level. */ export declare function getLogLevel(): LogLevel; /** * Get the current log format. */ export declare function getLogFormat(): 'console' | 'json'; /** * Set request ID for the current async context. */ export declare function setRequestId(requestId: string | null): void; /** * Get the current request ID from async context. */ export declare function getRequestId(): string | null; /** * Run a function with a specific request ID. */ export declare function withRequestId(requestId: string, fn: () => T): T; /** * Create a logger for a specific component. * * @param name - Name of the component (e.g., 'dexalot_sdk.clob') * @returns Logger instance */ export declare function getLogger(name: string): Logger; /** * Track an operation with timing (start, success with duration, or failure). * * @param logger - Logger to use * @param operation - Operation name * @param fn - Async function to execute * @param context - Additional context to log * @returns Result of the function */ export declare function trackOperation(logger: Logger, operation: string, fn: () => Promise, context?: Record): Promise; /** * Method decorator that logs entry, duration, and errors with a component tag. * * Note: TypeScript decorators are experimental. Use this with * `experimentalDecorators: true` in tsconfig.json. * * @param component - Component name for logging * @returns Method decorator * * @example * class MyClass { * @trackMethod('clob') * async getOrderBook(pair: string) { ... } * } */ export declare function trackMethod(component: string): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Log an event (for simpler logging without timing). */ export declare function logEvent(logger: Logger, level: LogLevel, event: string, context?: Record): void; //# sourceMappingURL=observability.d.ts.map