MCPcopy
hub / github.com/laurentj/slimerjs / dumpn

Function dumpn

src/components/httpd.js:171–193  ·  view source on GitHub ↗

dump(str) with a trailing "\n" -- only outputs if DEBUG.

(str)

Source from the content-addressed store, hash-verified

169
170/** dump(str) with a trailing "\n" -- only outputs if DEBUG. */
171function dumpn(str)
172{
173 if (DEBUG)
174 {
175 var prefix = "HTTPD-INFO | ";
176 if (DEBUG_TIMESTAMP)
177 {
178 if (firstStamp === 0)
179 firstStamp = Date.now();
180
181 var elapsed = Date.now() - firstStamp; // milliseconds
182 var min = Math.floor(elapsed / 60000);
183 var sec = (elapsed % 60000) / 1000;
184
185 if (sec < 10)
186 prefix += min + ":0" + sec.toFixed(3) + " | ";
187 else
188 prefix += min + ":" + sec.toFixed(3) + " | ";
189 }
190
191 dump(prefix + str + "\n");
192 }
193}
194
195/** Dumps the current JS stack if DEBUG. */
196function dumpStack()

Callers 6

NS_ASSERTFunction · 0.85
printObjFunction · 0.85
httpd.jsFile · 0.85
ConnectionFunction · 0.85
maybeAddHeadersFunction · 0.85
WriteThroughCopierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected