"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = exports.CustomLogger = void 0;
const common_1 = require("@nestjs/common");
class CustomLogger extends common_1.Logger {
    constructor(context) {
        super(context || 'Logger');
    }
    info(message) {
        const timestamp = new Date().toISOString();
        const formattedMessage = this.formatMessage(message, 'LOG', timestamp);
        super.log(formattedMessage);
    }
    error(message, trace) {
        const timestamp = new Date().toISOString();
        const formattedMessage = this.formatMessage(message, 'ERROR', timestamp);
        super.error(formattedMessage, trace);
    }
    warning(message) {
        const timestamp = new Date().toISOString();
        const formattedMessage = this.formatMessage(message, 'WARN', timestamp);
        super.warn(formattedMessage);
    }
    writeToStderr(message, level) {
        const timestamp = new Date().toISOString();
        const formatted = this.formatMessage(message, level, timestamp);
        console.error(formatted);
    }
    formatMessage(message, level, timestamp) {
        const messageString = typeof message === 'object' ? JSON.stringify(message, null, 2) : message;
        return `${timestamp} [${level}]: ${messageString}`;
    }
}
exports.CustomLogger = CustomLogger;
exports.logger = new CustomLogger();
//# sourceMappingURL=logger.config.js.map