debug/example/browser.html

31 lines
659 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>debug()</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>