bc-webclient-mcp
Version:
Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server
85 lines • 2.42 kB
TypeScript
/**
* Centralized logging utilities with structured logging support
*
* Uses pino for high-performance, structured JSON logging.
* Provides context-aware child loggers for tracing operations.
*/
import pino from 'pino';
import type { Logger as PinoLogger } from 'pino';
/**
* Log levels supported by the logger
*/
export type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
/**
* Global logger instance
*/
export declare const logger: pino.Logger;
/**
* Create a child logger with additional context
*
* @param context - Additional fields to include in all log messages
* @returns A child logger instance
*
* @example
* ```typescript
* const toolLogger = createChildLogger({ tool: 'GetPageMetadata', pageId: '21' });
* toolLogger.info('Opening page'); // Includes tool and pageId in output
* ```
*/
export declare function createChildLogger(context: Record<string, unknown>): PinoLogger;
/**
* Create a logger for a specific tool
*
* @param toolName - Name of the tool
* @param pageContextId - Optional page context for the operation
* @returns A child logger with tool context
*/
export declare function createToolLogger(toolName: string, pageContextId?: string): PinoLogger;
/**
* Create a logger for connection operations
*
* @param sessionId - Session identifier
* @param operation - Operation being performed
* @returns A child logger with connection context
*/
export declare function createConnectionLogger(sessionId: string, operation?: string): PinoLogger;
/**
* Log level utilities
*/
export declare const LogLevels: {
/**
* Check if debug logging is enabled
*/
isDebugEnabled(): boolean;
/**
* Check if trace logging is enabled
*/
isTraceEnabled(): boolean;
/**
* Set the log level dynamically
*/
setLevel(level: LogLevel): void;
/**
* Get current log level
*/
getLevel(): string;
};
/**
* Gracefully shutdown the logger, allowing pending messages to be written
*
* @returns Promise that resolves after brief delay for log writes
*/
export declare function shutdownLogger(): Promise<void>;
/**
* Check if logger is shutting down
*/
export declare function isLoggerShuttingDown(): boolean;
/**
* Export pino types for consumers
*/
export type { Logger } from 'pino';
/**
* Default export for convenience
*/
export default logger;
//# sourceMappingURL=logger.d.ts.map