UNPKG

@z-test/memory-bank-mcp

Version:
94 lines (93 loc) 2.23 kB
/** * LogManager - Utility for managing logs in Memory Bank MCP * * This utility provides functions for logging messages with different levels * and controls log visibility based on debug mode. */ /** * Log levels */ export declare enum LogLevel { DEBUG = "debug", INFO = "info", WARN = "warn", ERROR = "error" } /** * Configuration for the log manager */ export interface LogManagerConfig { debugMode: boolean; showTimestamp: boolean; showSource: boolean; minLevel: LogLevel; } /** * Log Manager class */ export declare class LogManager { private static instance; private config; /** * Private constructor to enforce singleton pattern */ private constructor(); /** * Get the singleton instance */ static getInstance(): LogManager; /** * Configure the log manager */ configure(config: Partial<LogManagerConfig>): void; /** * Enable debug mode */ enableDebugMode(): void; /** * Disable debug mode */ disableDebugMode(): void; /** * Check if a message should be logged based on current configuration */ private shouldLog; /** * Format a log message */ private formatMessage; /** * Log a debug message */ debug(source: string, message: string): void; /** * Log an info message */ info(source: string, message: string): void; /** * Log a warning message */ warn(source: string, message: string): void; /** * Log an error message */ error(source: string, message: string): void; /** * Log a message with a specific level */ log(level: LogLevel, source: string, message: string): void; } /** * Convenience function to get the log manager instance */ export declare function getLogManager(): LogManager; /** * Convenience functions for logging */ export declare const logger: { debug: (source: string, message: string) => void; info: (source: string, message: string) => void; warn: (source: string, message: string) => void; error: (source: string, message: string) => void; log: (level: LogLevel, source: string, message: string) => void; };