控制台输出控制开关

  var Debugger = function () { 
    };
    //开关,是否显示输出
    Debugger.switch = true;
    Debugger.log = function (message){
        try{
            if(Debugger.switch){
                console.log(message);
            }                  
        }catch(exception){
            return 'Error:the function  log is not exist.';
        }
    }
    Debugger.switch = false;//关闭控制台输出

 

posted @ 2017-12-08 19:24  a权  阅读(119)  评论(0编辑  收藏  举报
Top