import { config } from "../config.js";
class Logger {
    isDebugEnabled() {
        return config.debug === true;
    }
    debug(message, data) {
        if (this.isDebugEnabled()) {
            const formattedData = data ? `\n${JSON.stringify(data, null, 2)}` : "";
            console.log(`[NodeLLM Debug] ${message}${formattedData}`);
        }
    }
    /**
     * Log HTTP request details for debugging
     */
    logRequest(provider, method, url, body) {
        if (this.isDebugEnabled()) {
            console.log(`[NodeLLM] [${provider}] Request: ${method} ${url}`);
            if (body) {
                console.log(JSON.stringify(body, null, 2));
            }
        }
    }
    /**
     * Log HTTP response details for debugging
     */
    logResponse(provider, status, statusText, body) {
        if (this.isDebugEnabled()) {
            console.log(`[NodeLLM] [${provider}] Response: ${status} ${statusText}`);
            if (body) {
                console.log(JSON.stringify(body, null, 2));
            }
        }
    }
    warn(message) {
        console.warn(`[NodeLLM] ${message}`);
    }
    error(message, error) {
        console.error(`[NodeLLM Error] ${message}`, error || "");
    }
    info(message) {
        console.log(`[NodeLLM] ${message}`);
    }
}
export const logger = new Logger();
