UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and

80 lines (79 loc) 2.73 kB
/** * NeuroLink Unified Logger Utility * * Centralized logging for the entire NeuroLink ecosystem * Supports both CLI --debug flag and NEUROLINK_DEBUG environment variable * Migrated from MCP logging with enhanced features */ export type LogLevel = "debug" | "info" | "warn" | "error"; interface LogEntry { level: LogLevel; message: string; timestamp: Date; data?: unknown; } declare class NeuroLinkLogger { private logLevel; private logs; private maxLogs; private isDebugMode; constructor(); setLogLevel(level: LogLevel): void; shouldLog(level: LogLevel): boolean; private getLogPrefix; /** * Outputs a log entry to the console based on the log level. * * @param level - The log level (debug, info, warn, error). * @param prefix - The formatted log prefix. * @param message - The log message. * @param data - Optional additional data to log. */ private outputToConsole; private log; debug(message: string, data?: unknown): void; info(message: string, data?: unknown): void; warn(message: string, data?: unknown): void; error(message: string, data?: unknown): void; getLogs(level?: LogLevel): LogEntry[]; clearLogs(): void; /** * Logs messages unconditionally using `console.log`. * * This method is part of a legacy simple logger interface for backward compatibility. * It bypasses the structured logging mechanism and should only be used when * unstructured, unconditional logging is required. * * @param args - The arguments to log. These are passed directly to `console.log`. */ always(...args: unknown[]): void; /** * Displays tabular data unconditionally using `console.table`. * * @param data - The data to display in table format */ table(data: unknown): void; } export declare const logger: { debug: (...args: unknown[]) => void; info: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; error: (...args: unknown[]) => void; always: (...args: unknown[]) => void; table: (data: unknown) => void; setLogLevel: (level: LogLevel) => void; getLogs: (level?: LogLevel) => LogEntry[]; clearLogs: () => void; }; export declare const mcpLogger: NeuroLinkLogger; export declare const autoDiscoveryLogger: NeuroLinkLogger; export declare const registryLogger: NeuroLinkLogger; export declare const unifiedRegistryLogger: NeuroLinkLogger; export declare function setGlobalMCPLogLevel(level: LogLevel): void; export declare const LogLevels: { readonly debug: "debug"; readonly info: "info"; readonly warn: "warn"; readonly error: "error"; }; export type { LogEntry };