Created
March 9, 2018 10:31
-
-
Save eirikblekesaune/1a60aeef8dbc3b3284a24f3b708c24cc to your computer and use it in GitHub Desktop.
For printing prettier and more informative in Max/js dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from: http://compusition.com/writings/js-live-api-logging | |
function log() { | |
for(var i=0,len=arguments.length; i<len; i++) { | |
var message = arguments[i]; | |
if(message && message.toString) { | |
var s = message.toString(); | |
if(s.indexOf("[object ") >= 0) { | |
s = JSON.stringify(message); | |
} | |
post(s); | |
} | |
else if(message === null) { | |
post("<null>"); | |
} | |
else { | |
post(message); | |
} | |
} | |
post("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment