Commit 2dab017e authored by Leo Iannacone's avatar Leo Iannacone

print on console.debug if exists - some usage inforation

parent 4cedb6e9
var socket = io.connect('//' + config.hostname );
/*
General indication for debugging use:
usage: debug(level, args)
args: can be everything
level: 1 - user interaction
2 - automatic changes
3 - socket interaction
*/
var debug = function() {
if (arguments.length == 0) {
return
}
var level = 1
if (arguments.length > 1) {
if (arguments.length > 2) {
level = arguments[0]
arguments[0] = "dubug (" + level + ") > "
arguments[0] = "debug (" + level + ") > "
if (level <= config.preferences.debug) {
if (console.debug)
console.debug.apply(console, arguments)
else
console.log.apply(console, arguments)
}
}
if (level <= config.preferences.debug) {
console.log.apply(console, arguments)
}
}
new Preferences()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment