码迷,mamicode.com
首页 > 其他好文 > 详细

控制台输出控制开关

时间:2017-12-08 20:44:37      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:exist   div   return   color   fun   error:   debugger   pre   err   

  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;//关闭控制台输出

 

控制台输出控制开关

标签:exist   div   return   color   fun   error:   debugger   pre   err   

原文地址:http://www.cnblogs.com/lzq035/p/8006875.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!