Skip to content

Instantly share code, notes, and snippets.

@mattlundstrom
Created December 15, 2013 09:23
Show Gist options
  • Select an option

  • Save mattlundstrom/7970740 to your computer and use it in GitHub Desktop.

Select an option

Save mattlundstrom/7970740 to your computer and use it in GitHub Desktop.
Flash trace() to console.log
import flash.external.ExternalInterface;
public static function log(msg:String, caller:Object = null):void{
var str:String = "";
if(caller){
str = getQualifiedClassName(caller);
str += ":: ";
}
str += msg;
trace(str);
if(ExternalInterface.available){
ExternalInterface.call("console.log", str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment