"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogTempaleBean = exports.LogUtils = void 0;
var mslib_1 = require("mslib");
var typescript_ioc_1 = require("typescript-ioc");
/**
 * 日志规范工具
 * @date 2023-09-15 11:38:20
 * @author 郁忠彪
 */
var LogUtils = /** @class */ (function () {
    function LogUtils() {
    }
    LogUtils.fatal = function (param) {
        return mslib_1.logger.fatal(this.getlogString(param));
    };
    LogUtils.error = function (param) {
        return mslib_1.logger.error(this.getlogString(param));
    };
    LogUtils.info = function (param) {
        return mslib_1.logger.info(this.getlogString(param));
    };
    LogUtils.debug = function (param) {
        return mslib_1.logger.debug(this.getlogString(param));
    };
    LogUtils.warn = function (param) {
        return mslib_1.logger.warn(this.getlogString(param));
    };
    LogUtils.getlogString = function (param) {
        if (!param.msgName && !param.msg && !param.parkId) {
            return '日志格式错误：msgName,msg,parkId为空！';
        }
        var logString = "[" + param.msgName + "\uFF1A" + param.msg + "]";
        if (param.toMethod) {
            logString = logString + ("----\u8DEF\u7531\uFF1A[" + param.toMethod + "]");
        }
        if (param.url) {
            logString = logString + ("----\u8BF7\u6C42\u5730\u5740\uFF1A[" + param.url + "]");
        }
        logString = logString + ("----\u8F66\u573Aid\uFF1A[" + param.parkId + "]");
        return logString;
    };
    return LogUtils;
}());
exports.LogUtils = LogUtils;
var LogTempaleBean = /** @class */ (function () {
    function LogTempaleBean() {
    }
    LogTempaleBean = __decorate([
        typescript_ioc_1.Singleton
    ], LogTempaleBean);
    return LogTempaleBean;
}());
exports.LogTempaleBean = LogTempaleBean;
//# sourceMappingURL=LogUtils.js.map