debug.js
debug.js copied to clipboard
建议修改debug.js的参数和console的参数形式一致。
for (fn in debugMap) {
Debug.prototype[fn] = (function(fn) {
return function() {
var msg;
if(arguments.length==1){
msg=arguments[0];
}else{
msg=[].slice.apply(arguments);
}
this.fn = fn;
this.msg = render(msg);
this.color = debugMap[fn];
return this.print();
};
})(fn);
}
这样就可以使用debug.log(1,2,3,4)
;
@as3long ok,多谢。我研究下console的api再完善下。