import consola from "consola"; import type { Logger, LogAttributes } from "@atbb/logger"; /** * CLI logger adapter that wraps consola to satisfy the Logger interface. * * This allows ForumAgent (which requires a structured Logger) to log through * consola for consistent CLI output. The CLI's own user-facing messages * continue to use consola directly. */ class ConsolaLoggerAdapter implements Logger { debug(message: string, attributes?: LogAttributes): void { if (attributes) { consola.debug(message, attributes); } else { consola.debug(message); } } info(message: string, attributes?: LogAttributes): void { if (attributes) { consola.info(message, attributes); } else { consola.info(message); } } warn(message: string, attributes?: LogAttributes): void { if (attributes) { consola.warn(message, attributes); } else { consola.warn(message); } } error(message: string, attributes?: LogAttributes): void { if (attributes) { consola.error(message, attributes); } else { consola.error(message); } } fatal(message: string, attributes?: LogAttributes): void { if (attributes) { consola.fatal(message, attributes); } else { consola.fatal(message); } } child(_attributes: LogAttributes): Logger { // consola doesn't support child loggers with base attributes, // so return this same instance return this; } async shutdown(): Promise { // No-op — consola doesn't need cleanup } } export const logger: Logger = new ConsolaLoggerAdapter();