You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
892 B
35 lines
892 B
import { Global } from './config';
|
|
|
|
|
|
const isLog = function (type, errText, enforce) {
|
|
if (!enforce) {
|
|
const dev = Global.Router.CONFIG.debugger;
|
|
const isObject = dev.toString() === '[object Object]';
|
|
if (dev === false) {
|
|
return false;
|
|
} if (dev === false) {
|
|
return false;
|
|
} if (isObject) {
|
|
if (dev[type] === false) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
/* eslint no-console:"off" */
|
|
console[type](errText);
|
|
};
|
|
export const err = function (errInfo, enforce = false) {
|
|
isLog('error', errInfo, enforce);
|
|
};
|
|
|
|
export const warn = function (errInfo, enforce = false) {
|
|
isLog('warn', errInfo, enforce);
|
|
};
|
|
|
|
export const log = function (errInfo, enforce = false) {
|
|
isLog('log', errInfo, enforce);
|
|
};
|
|
export const warnLock = function (errInfo) {
|
|
console.warn(errInfo);
|
|
};
|