@icreate/core
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -170,3 +170,3 @@ /* | ||
* @LastEditors: 文贝 | ||
* @LastEditTime: 2022-03-11 09:41:09 | ||
* @LastEditTime: 2022-03-11 09:47:27 | ||
* @Descripttion: | ||
@@ -187,3 +187,3 @@ * @FilePath: \src\core\logger.ts | ||
Logger.prototype.log = function (logObject, logLevel, color) { | ||
if (color === void 0) { color = '#b5cea8'; } | ||
if (color === void 0) { color = null; } | ||
if (typeof window === 'undefined' || !window.console || !window.console.log) { | ||
@@ -195,3 +195,8 @@ return; | ||
} | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
if (color) { | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
} | ||
else { | ||
console.log(logObject); | ||
} | ||
}; | ||
@@ -204,4 +209,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("DEBUG: " + message, LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, LogLevels.DEBUG, this.color.debug); | ||
this.log("%cDEBUG: " + message, LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, LogLevels.DEBUG); | ||
}; | ||
@@ -214,4 +219,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("INFO: " + message, LogLevels.INFO, this.color.info); | ||
this.log(logObject, LogLevels.INFO, this.color.info); | ||
this.log("%cINFO: " + message, LogLevels.INFO, this.color.info); | ||
this.log(logObject, LogLevels.INFO); | ||
}; | ||
@@ -224,4 +229,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("WARN: " + message, LogLevels.WARN, this.color.warn); | ||
this.log(logObject, LogLevels.WARN, this.color.warn); | ||
this.log("%cWARN: " + message, LogLevels.WARN, this.color.warn); | ||
this.log(logObject, LogLevels.WARN); | ||
}; | ||
@@ -234,4 +239,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("ERROR: " + message, LogLevels.ERROR, this.color.error); | ||
this.log(logObject, LogLevels.ERROR, this.color.error); | ||
this.log("%cERROR: " + message, LogLevels.ERROR, this.color.error); | ||
this.log(logObject, LogLevels.ERROR); | ||
}; | ||
@@ -244,4 +249,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("FATAL: " + message, LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, LogLevels.FATAL, this.color.fatal); | ||
this.log("%cFATAL: " + message, LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, LogLevels.FATAL); | ||
}; | ||
@@ -248,0 +253,0 @@ return Logger; |
@@ -175,3 +175,3 @@ (function (global, factory) { | ||
* @LastEditors: 文贝 | ||
* @LastEditTime: 2022-03-11 09:41:09 | ||
* @LastEditTime: 2022-03-11 09:47:27 | ||
* @Descripttion: | ||
@@ -192,3 +192,3 @@ * @FilePath: \src\core\logger.ts | ||
Logger.prototype.log = function (logObject, logLevel, color) { | ||
if (color === void 0) { color = '#b5cea8'; } | ||
if (color === void 0) { color = null; } | ||
if (typeof window === 'undefined' || !window.console || !window.console.log) { | ||
@@ -200,3 +200,8 @@ return; | ||
} | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
if (color) { | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
} | ||
else { | ||
console.log(logObject); | ||
} | ||
}; | ||
@@ -209,4 +214,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("DEBUG: " + message, exports.LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, exports.LogLevels.DEBUG, this.color.debug); | ||
this.log("%cDEBUG: " + message, exports.LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, exports.LogLevels.DEBUG); | ||
}; | ||
@@ -219,4 +224,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("INFO: " + message, exports.LogLevels.INFO, this.color.info); | ||
this.log(logObject, exports.LogLevels.INFO, this.color.info); | ||
this.log("%cINFO: " + message, exports.LogLevels.INFO, this.color.info); | ||
this.log(logObject, exports.LogLevels.INFO); | ||
}; | ||
@@ -229,4 +234,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("WARN: " + message, exports.LogLevels.WARN, this.color.warn); | ||
this.log(logObject, exports.LogLevels.WARN, this.color.warn); | ||
this.log("%cWARN: " + message, exports.LogLevels.WARN, this.color.warn); | ||
this.log(logObject, exports.LogLevels.WARN); | ||
}; | ||
@@ -239,4 +244,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("ERROR: " + message, exports.LogLevels.ERROR, this.color.error); | ||
this.log(logObject, exports.LogLevels.ERROR, this.color.error); | ||
this.log("%cERROR: " + message, exports.LogLevels.ERROR, this.color.error); | ||
this.log(logObject, exports.LogLevels.ERROR); | ||
}; | ||
@@ -249,4 +254,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("FATAL: " + message, exports.LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, exports.LogLevels.FATAL, this.color.fatal); | ||
this.log("%cFATAL: " + message, exports.LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, exports.LogLevels.FATAL); | ||
}; | ||
@@ -253,0 +258,0 @@ return Logger; |
@@ -7,3 +7,3 @@ "use strict"; | ||
* @LastEditors: 文贝 | ||
* @LastEditTime: 2022-03-11 09:41:09 | ||
* @LastEditTime: 2022-03-11 09:47:27 | ||
* @Descripttion: | ||
@@ -25,3 +25,3 @@ * @FilePath: \src\core\logger.ts | ||
Logger.prototype.log = function (logObject, logLevel, color) { | ||
if (color === void 0) { color = '#b5cea8'; } | ||
if (color === void 0) { color = null; } | ||
if (typeof window === 'undefined' || !window.console || !window.console.log) { | ||
@@ -33,3 +33,8 @@ return; | ||
} | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
if (color) { | ||
console.log(logObject, "color: " + color + ";font-size: 14px;font-weight: normal;line-height: 19px;font-family: Consolas, \"Courier New\", monospace;"); | ||
} | ||
else { | ||
console.log(logObject); | ||
} | ||
}; | ||
@@ -42,4 +47,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("DEBUG: " + message, interfaces_1.LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, interfaces_1.LogLevels.DEBUG, this.color.debug); | ||
this.log("%cDEBUG: " + message, interfaces_1.LogLevels.DEBUG, this.color.debug); | ||
this.log(logObject, interfaces_1.LogLevels.DEBUG); | ||
}; | ||
@@ -52,4 +57,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("INFO: " + message, interfaces_1.LogLevels.INFO, this.color.info); | ||
this.log(logObject, interfaces_1.LogLevels.INFO, this.color.info); | ||
this.log("%cINFO: " + message, interfaces_1.LogLevels.INFO, this.color.info); | ||
this.log(logObject, interfaces_1.LogLevels.INFO); | ||
}; | ||
@@ -62,4 +67,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("WARN: " + message, interfaces_1.LogLevels.WARN, this.color.warn); | ||
this.log(logObject, interfaces_1.LogLevels.WARN, this.color.warn); | ||
this.log("%cWARN: " + message, interfaces_1.LogLevels.WARN, this.color.warn); | ||
this.log(logObject, interfaces_1.LogLevels.WARN); | ||
}; | ||
@@ -72,4 +77,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("ERROR: " + message, interfaces_1.LogLevels.ERROR, this.color.error); | ||
this.log(logObject, interfaces_1.LogLevels.ERROR, this.color.error); | ||
this.log("%cERROR: " + message, interfaces_1.LogLevels.ERROR, this.color.error); | ||
this.log(logObject, interfaces_1.LogLevels.ERROR); | ||
}; | ||
@@ -82,4 +87,4 @@ /** | ||
if (message === void 0) { message = ''; } | ||
this.log("FATAL: " + message, interfaces_1.LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, interfaces_1.LogLevels.FATAL, this.color.fatal); | ||
this.log("%cFATAL: " + message, interfaces_1.LogLevels.FATAL, this.color.fatal); | ||
this.log(logObject, interfaces_1.LogLevels.FATAL); | ||
}; | ||
@@ -86,0 +91,0 @@ return Logger; |
{ | ||
"name": "@icreate/core", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "Ics核心包封装", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1921
153575