Commit 021db091 authored by Leo Iannacone's avatar Leo Iannacone

fix arguments length - required at least 2 args

parent 3f9a6b68
...@@ -11,12 +11,10 @@ ...@@ -11,12 +11,10 @@
4 - socket received data 4 - socket received data
*/ */
var debug = function() { var debug = function() {
if (arguments.length == 0) { if (arguments.length < 2) {
return return
} }
var level = 1 var level = arguments[0]
if (arguments.length > 2) {
level = arguments[0]
arguments[0] = "debug [" + level + "]:" arguments[0] = "debug [" + level + "]:"
if (level <= config.preferences.debug) { if (level <= config.preferences.debug) {
if (console.debug) if (console.debug)
...@@ -24,7 +22,6 @@ var debug = function() { ...@@ -24,7 +22,6 @@ var debug = function() {
else else
console.log.apply(console, arguments) console.log.apply(console, arguments)
} }
}
} }
/* /*
......
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