Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

肖康 / H5_2.0

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
Normal viewHistoryPermalink
Switch branch/tag
  • H5_2.0
  • node_modules
  • _uni-simple-router@1.5.5@uni-simple-r...
  • helpers
  • warn.js
warn.js 892 Bytes
肖康's avatar
first init
ddbafbda
 
肖康 committed 2 years ago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
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);
};