"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = void 0;
const path_1 = __importDefault(require("path"));
const winston_1 = require("winston");
const constants_1 = require("./constants");
exports.logger = (0, winston_1.createLogger)({
    level: 'info',
    format: winston_1.format.combine(winston_1.format.timestamp({
        format: 'YYYY-MM-DD HH:mm:ss',
    }), winston_1.format.errors({ stack: true }), winston_1.format.splat(), winston_1.format.json(), winston_1.format.prettyPrint()),
    transports: [
        new winston_1.transports.File({
            filename: path_1.default.resolve(constants_1.OUTPUT_DIRECTORY, 'error.log'),
            level: 'error',
        }),
        new winston_1.transports.File({
            filename: path_1.default.resolve(constants_1.OUTPUT_DIRECTORY, 'all.log'),
        }),
        new winston_1.transports.Console({
            format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.simple()),
            level: 'error',
        }),
    ],
});
