You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
862 B
JavaScript

DebugSettings = {};
function DEBUG(text) {
Fn = DEBUG.caller.name;
proceed_with_msg = false;
if ('all' in DebugSettings) {
if (!DebugSettings['all']) {
return;
}
else if (DebugSettings['all']) {
proceed_with_msg = true;
}
}
else if (Fn in DebugSettings) {
if (DebugSettings[Fn] == false) {
proceed_with_msg = false;
}
else {
proceed_with_msg = true;
}
}
else {
proceed_with_msg = true;
}
if (proceed_with_msg == true) {
str = 'console.log("[" + Fn + "()] ::"';
for (var i = 0; i < arguments.length; i++) {
str += ', arguments[' + i + ']';
}
str += ');';
eval(str);
}
return;
}
function DebugConfig(settings) {
DebugSettings = settings;
}