-
Notifications
You must be signed in to change notification settings - Fork 0
/
modularExecuteCommandDebug.t
85 lines (74 loc) · 1.73 KB
/
modularExecuteCommandDebug.t
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#charset "us-ascii"
//
// modularExecuteCommandDebug.t
//
// Debugging methods for the modularExecuteCommand stuff.
//
#include <adv3.h>
#include <en_us.h>
#ifdef __DEBUG_MODULAR_EXECUTE_COMMAND
#include <reflect.t>
modify ModularExecuteCommandObject
// Log the passed message. Prefixes the value of the
// object's modularExecuteCommandID, if set.
_debug(msg?) {
aioSay('\n<<(modularExecuteCommandID
? '<<modularExecuteCommandID>>: '
: '')>><<msg>>\n ');
}
// Debug a list.
_debugList(lst) {
local l;
if(lst == nil) {
_debug('_debugList(): nil list');
return;
}
_debug('=====_debugList() start=====');
_debug('lst.length = <<toString(lst.length)>>');
lst.forEach(function(obj) {
if(obj == nil) {
_debug('object is nil');
return;
}
_debug(reflectionServices.valToSymbol(obj));
if((l = obj.getPropList()) == nil) {
_debug('no properties');
return;
}
l.forEach(function(o) {
if(!obj.propDefined(o, PropDefAny))
return;
_debug('\t'
+ reflectionServices.valToSymbol(o)
+ ' = '
+ reflectionServices.valToSymbol(
obj.(o)));
});
});
_debug('=====_debugList() end=====');
}
// Debug an object, shallowly.
_debugObject(obj, lbl?) {
_debug((lbl ? lbl : '')
+ '<<reflectionServices.valToSymbol(obj)>>');
}
// Debug an object, fully.
_debugObjectFull(obj) {
local l;
if(obj == nil) {
_debug('nil object');
return;
}
if((l = obj.getPropList()) == nil) {
_debug('\t[no properties]\n ');
return;
}
l.forEach(function(o) {
if(!obj.propDefined(o, PropDefAny))
return;
_debug('\t' + reflectionServices.valToSymbol(o) + ' = '
+ reflectionServices.valToSymbol(obj.(o)));
});
}
;
#endif // __DEBUG_MODULAR_EXECUTE_COMMAND