Skip to content

Instantly share code, notes, and snippets.

@eirikblekesaune
Created March 9, 2018 10:31
Show Gist options
  • Save eirikblekesaune/1a60aeef8dbc3b3284a24f3b708c24cc to your computer and use it in GitHub Desktop.
Save eirikblekesaune/1a60aeef8dbc3b3284a24f3b708c24cc to your computer and use it in GitHub Desktop.
For printing prettier and more informative in Max/js dev
//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