log() emits a stack-trace, rather than a function listing, when mkws.log_level >= 3.
authorMike Taylor <mike@indexdata.com>
Tue, 29 Apr 2014 10:32:52 +0000 (11:32 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 29 Apr 2014 10:32:52 +0000 (11:32 +0100)
src/mkws-core.js

index 0bfc174..e08958f 100644 (file)
@@ -88,7 +88,8 @@ mkws.log = function(string) {
 
     // you need to disable use strict at the top of the file!!!
     if (mkws.log_level >= 3) {
-       console.log(arguments.callee.caller);
+        // Works in Chrome; not sure about elsewhere
+       console.trace();
     } else if (mkws.log_level >= 2) {
        console.log(">>> called from function " + arguments.callee.caller.name + ' <<<');
     }