"use strict";
/**
 * MIGRATED: React-compatible logger using shared utilities from @bluefly/llmcli
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentLogger = exports.logger = void 0;
exports.useLogger = useLogger;
// Simple logger implementation - no external dependency needed
const createLogger = (config) => ({
    debug: (msg, data) => console.debug(`[${config.service}] ${msg}`, data),
    info: (msg, data) => console.info(`[${config.service}] ${msg}`, data),
    warn: (msg, data) => console.warn(`[${config.service}] ${msg}`, data),
    error: (msg, data) => console.error(`[${config.service}] ${msg}`, data),
});
// Create shared logger instance for UI components
exports.logger = createLogger({
    service: 'bfui',
    level: (process.env.NODE_ENV === 'development' ? 'debug' : 'info'),
    environment: process.env.NODE_ENV || 'production',
    pretty: process.env.NODE_ENV === 'development'
});
/**
 * React component logger with component context
 */
class ComponentLogger {
    constructor(componentName) {
        this.component = componentName;
    }
    debug(message, data) {
        exports.logger.debug(message, { component: this.component, ...data });
    }
    info(message, data) {
        exports.logger.info(message, { component: this.component, ...data });
    }
    warn(message, data) {
        exports.logger.warn(message, { component: this.component, ...data });
    }
    error(message, error, data) {
        exports.logger.error(message, {
            component: this.component,
            error: error?.message || error,
            stack: error?.stack,
            ...data
        });
    }
}
exports.ComponentLogger = ComponentLogger;
/**
 * Hook-style logger for React components
 */
function useLogger(componentName) {
    return new ComponentLogger(componentName);
}
// Export default logger for backward compatibility
exports.default = exports.logger;
//# sourceMappingURL=logger.js.map