sk-js
Version:
JavaScript for ShaneKing
46 lines (38 loc) • 1.63 kB
JavaScript
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
import Proxy0 from './Proxy0';
import SK from './SK';
var Console0 =
/*#__PURE__*/
function () {
function Console0() {
_classCallCheck(this, Console0);
}
_createClass(Console0, null, [{
key: "log",
value: function log(message) {
Console0.msg(message);
}
}, {
key: "warn",
value: function warn(message) {
Console0.msg(message, 'warn');
}
}, {
key: "error",
value: function error(message) {
Console0.msg(message, 'error');
}
}, {
key: "msg",
value: function msg(message) {
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'log';
if (console[type]) {
console[type]("".concat(Proxy0.moment().format("".concat(SK.DEFAULT_MOMENT_Y_M_D, "T").concat(SK.DEFAULT_MOMENT_H_MI_S)), ": ").concat(type, ": ").concat(JSON.stringify(message)));
}
}
}]);
return Console0;
}();
export { Console0 as default };