-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathDebugControl.js
41 lines (36 loc) · 862 Bytes
/
DebugControl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
}