"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loggerSlack = void 0;
const strip_ansi_1 = __importDefault(require("strip-ansi"));
const { IncomingWebhook } = require("@slack/webhook");
const url = "https://hooks.slack.com/services/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";
const webhook = new IncomingWebhook(url);
exports.loggerSlack = {
    write: (message) => {
        if (process.env.NODE_ENV === "production") {
            webhook.send({
                text: (0, strip_ansi_1.default)("```" + message + "```"),
            });
        }
        else if (process.env.NODE_ENV === "development") {
            console.log("ERROR", message);
        }
    },
};
