/** * Configurable logger for Discord connector operations * * Implements log level filtering based on configuration: * - minimal: Only errors and critical state changes * - standard: Connection events, message counts, session operations (default) * - verbose: All messages logged with optional content redaction */ import type { AgentChatDiscord } from "@herdctl/core"; import type { DiscordConnectorLogger } from "./types.js"; /** * Log level hierarchy for filtering * Higher number = more severe = always logged */ export type DiscordLogLevel = "minimal" | "standard" | "verbose"; /** * Options for configuring the Discord logger */ export interface DiscordLoggerOptions { /** * Name of the agent this logger is for */ agentName: string; /** * Log level setting from config * @default "standard" */ logLevel?: DiscordLogLevel; /** * Whether to redact message content in verbose mode * @default true */ redactContent?: boolean; /** * Custom prefix for log messages * @default "[discord:agentName]" */ prefix?: string; } /** * Configurable logger for Discord connector operations * * Implements log level filtering based on configuration: * - minimal: Only errors and critical state changes (warn/error) * - standard: Connection events, message counts, session operations (info/warn/error) * - verbose: All messages logged with optional content redaction (debug/info/warn/error) * * @example * ```typescript * const logger = new DiscordLogger({ * agentName: 'my-agent', * logLevel: 'standard', * redactContent: true, * }); * * logger.info('Connected to Discord', { username: 'Bot#1234' }); * logger.debug('Debug message', { sensitive: 'data' }); // Filtered out in standard mode * ``` */ export declare class DiscordLogger implements DiscordConnectorLogger { private readonly agentName; private readonly logLevel; private readonly redactContent; private readonly prefix; private readonly levelValue; constructor(options: DiscordLoggerOptions); /** * Check if a log method should output based on current log level */ private shouldLog; /** * Process data for logging, applying redaction if needed */ private processData; /** * Format and output a log message */ private log; /** * Log a debug message (only visible in verbose mode) */ debug(message: string, data?: Record): void; /** * Log an info message (visible in standard and verbose modes) */ info(message: string, data?: Record): void; /** * Log a warning message (always visible) */ warn(message: string, data?: Record): void; /** * Log an error message (always visible) */ error(message: string, data?: Record): void; /** * Get the current log level */ getLogLevel(): DiscordLogLevel; /** * Check if redaction is enabled */ isRedactionEnabled(): boolean; } /** * Create a DiscordLogger from agent Discord configuration * * @param agentName - Name of the agent * @param discordConfig - Discord configuration from agent config * @returns Configured DiscordLogger instance */ export declare function createLoggerFromConfig(agentName: string, discordConfig: AgentChatDiscord): DiscordLogger; /** * Create a default logger for an agent (standard log level) * * @param agentName - Name of the agent * @returns DiscordLogger with default settings */ export declare function createDefaultDiscordLogger(agentName: string): DiscordLogger; //# sourceMappingURL=logger.d.ts.map