@jdeighan/coffee-utils 7.0.53 → 7.0.54
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/call_stack.coffee +1 -1
- package/src/call_stack.js +1 -1
- package/src/debug_utils.coffee +11 -6
- package/src/debug_utils.js +10 -6
package/package.json
CHANGED
package/src/call_stack.coffee
CHANGED
package/src/call_stack.js
CHANGED
@@ -168,7 +168,7 @@ export var CallStack = class CallStack {
|
|
168
168
|
ref = this.lStack;
|
169
169
|
for (i = j = 0, len = ref.length; j < len; i = ++j) {
|
170
170
|
item = ref[i];
|
171
|
-
LOG(` ${i}: ${
|
171
|
+
LOG(` ${i}: ${item.fullName} ${item.isLogged}`);
|
172
172
|
}
|
173
173
|
}
|
174
174
|
}
|
package/src/debug_utils.coffee
CHANGED
@@ -95,7 +95,7 @@ export debug = (label, lObjects...) ->
|
|
95
95
|
for obj in lObjects
|
96
96
|
logItem undef, obj, {prefix}
|
97
97
|
|
98
|
-
if (type == 'enter') && doLog
|
98
|
+
if (type == 'enter') && doLog && (label.indexOf('call') == -1)
|
99
99
|
callStack.logCurFunc()
|
100
100
|
else if (type == 'return')
|
101
101
|
callStack.returnFrom funcName
|
@@ -119,20 +119,25 @@ export stdShouldLog = (label, type, funcName, stack) ->
|
|
119
119
|
else
|
120
120
|
assert funcName == undef, "func name #{OL(funcName)} not undef"
|
121
121
|
assert stack instanceof CallStack, "not a call stack object"
|
122
|
+
|
122
123
|
if doDebugDebug
|
123
124
|
LOG "stdShouldLog(#{OL(label)}, #{OL(type)}, #{OL(funcName)}, stack)"
|
124
125
|
LOG "stack", stack
|
125
126
|
LOG "lFuncList", lFuncList
|
127
|
+
|
126
128
|
switch type
|
127
129
|
when 'enter'
|
128
130
|
if funcMatch(stack, lFuncList)
|
129
131
|
return label
|
130
132
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
else
|
134
|
+
# --- As a special case, if we enter a function where we will not
|
135
|
+
# be logging, but we were logging in the calling function,
|
136
|
+
# we'll log out the call itself
|
137
|
+
|
138
|
+
prevLogged = stack.isLoggingPrev()
|
139
|
+
if prevLogged
|
140
|
+
return label.replace('enter', 'call')
|
136
141
|
else
|
137
142
|
if funcMatch(stack, lFuncList)
|
138
143
|
return label
|
package/src/debug_utils.js
CHANGED
@@ -153,7 +153,7 @@ export var debug = function(label, ...lObjects) {
|
|
153
153
|
}
|
154
154
|
}
|
155
155
|
}
|
156
|
-
if ((type === 'enter') && doLog) {
|
156
|
+
if ((type === 'enter') && doLog && (label.indexOf('call') === -1)) {
|
157
157
|
callStack.logCurFunc();
|
158
158
|
} else if (type === 'return') {
|
159
159
|
callStack.returnFrom(funcName);
|
@@ -164,6 +164,7 @@ export var debug = function(label, ...lObjects) {
|
|
164
164
|
|
165
165
|
// ---------------------------------------------------------------------------
|
166
166
|
export var stdShouldLog = function(label, type, funcName, stack) {
|
167
|
+
var prevLogged;
|
167
168
|
// --- if type is 'enter', then funcName won't be on the stack yet
|
168
169
|
// returns the (possibly modified) label to log
|
169
170
|
|
@@ -187,11 +188,14 @@ export var stdShouldLog = function(label, type, funcName, stack) {
|
|
187
188
|
case 'enter':
|
188
189
|
if (funcMatch(stack, lFuncList)) {
|
189
190
|
return label;
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
191
|
+
} else {
|
192
|
+
// --- As a special case, if we enter a function where we will not
|
193
|
+
// be logging, but we were logging in the calling function,
|
194
|
+
// we'll log out the call itself
|
195
|
+
prevLogged = stack.isLoggingPrev();
|
196
|
+
if (prevLogged) {
|
197
|
+
return label.replace('enter', 'call');
|
198
|
+
}
|
195
199
|
}
|
196
200
|
break;
|
197
201
|
default:
|