debug/example/browser.html
Tim Oxley dd32a4c902 Make console logging function configurable.
Split log() into 2 methods: formatArgs() and log(), allowing log to be
overridden on a per-namespace or global level. Global log settings trump
per-namespace settings.
2014-06-07 23:34:39 -07:00

30 lines
587 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>debug()</title>
<script src="../dist/debug.js"></script>
<script>
// type debug.enable('*') in
// the console and refresh :)
var a = debug('worker:a');
var b = debug('worker:b');
// set all output to go via console.info
// instead of console.log
debug.log = console.info.bind(console);
setInterval(function(){
a('doing some work');
}, 1000);
setInterval(function(){
b('doing some work');
}, 1200);
</script>
</head>
<body>
</body>
</html>