@toolprint/hypertool-mcp
Version:
HyperTool MCP proxy server for routing requests between clients and multiple underlying MCP servers
58 lines • 2.1 kB
TypeScript
/**
* Logger factory that selects implementation based on feature flags
*/
import { RuntimeOptions } from "../../types/runtime.js";
import { LoggerInterface, LoggingConfig, LoggerFactory } from "./interfaces.js";
/**
* Logger factory implementation that selects between Pino and mcp-logger
* based on feature flag configuration
*/
export declare class HypertoolLoggerFactory implements LoggerFactory {
private static instance;
private mcpLoggerEnabled;
private constructor();
/**
* Get singleton instance
*/
static getInstance(): HypertoolLoggerFactory;
/**
* Check feature flag status (with caching)
*/
private checkMcpLoggerEnabled;
/**
* Create logger instance based on feature flag
*/
createLogger(config?: Partial<LoggingConfig>, runtimeOptions?: RuntimeOptions): Promise<LoggerInterface>;
/**
* Create child logger - delegates to existing global logger
*/
createChildLogger(bindings: {
module: string;
}): LoggerInterface;
/**
* Synchronous logger creation for cases where async is not possible
* Uses forced value first, then environment variable as fallback
*/
createLoggerSync(config?: Partial<LoggingConfig>, runtimeOptions?: RuntimeOptions): LoggerInterface;
/**
* Reset feature flag cache (mainly for testing)
*/
resetCache(): void;
/**
* Force set feature flag (for testing)
*/
forceSetMcpLoggerEnabled(enabled: boolean): void;
}
/**
* Get the singleton factory instance
*/
export declare function getLoggerFactory(): HypertoolLoggerFactory;
/**
* Convenience function to create a logger with feature flag selection
*/
export declare function createLoggerWithFeatureFlag(config?: Partial<LoggingConfig>, runtimeOptions?: RuntimeOptions): Promise<LoggerInterface>;
/**
* Synchronous convenience function for cases where async is not possible
*/
export declare function createLoggerSyncWithFeatureFlag(config?: Partial<LoggingConfig>, runtimeOptions?: RuntimeOptions): LoggerInterface;
//# sourceMappingURL=factory.d.ts.map