Uui*_*uid 20 javascript jquery
我具备的功能日志与传递的参数,我怎么能打印的内容和在同一时间总是打印的字一起打印数据"报告:"在日志的beggining.
function Log(){
if (app.debug_logs){
if(console && console.log){
console.log.apply(console, "Report: " + arguments);
}
}
}
Log(" error ocurred ", " on this log... ");
Run Code Online (Sandbox Code Playgroud)
我希望:"报告:此日志出现错误......"
谢谢.
Aru*_*hny 48
您可以console.log
轻松覆盖
(function(){
if(window.console && console.log){
var old = console.log;
console.log = function(){
Array.prototype.unshift.call(arguments, 'Report: ');
old.apply(this, arguments)
}
}
})();
console.log('test')
Run Code Online (Sandbox Code Playgroud)
演示:小提琴
归档时间: |
|
查看次数: |
12492 次 |
最近记录: |