Add log utility
This commit is contained in:
parent
822f6d7860
commit
8d9c8d3bbb
1 changed files with 15 additions and 0 deletions
15
src/org/gestouch/utils/log.as
Normal file
15
src/org/gestouch/utils/log.as
Normal file
|
@ -0,0 +1,15 @@
|
|||
package org.gestouch.utils
|
||||
{
|
||||
public function log(...args):void
|
||||
{
|
||||
// You can switch to custom logging if you really need it for debugging
|
||||
|
||||
var tmp:Array = new Error().getStackTrace().split("\n");
|
||||
tmp = tmp[2].split(" ");
|
||||
tmp = tmp[1].split("[");
|
||||
// tmp[0] is a string "class/method()"
|
||||
|
||||
args.unshift("[Gestouch]", tmp[0]);
|
||||
trace.apply(null, args);
|
||||
}
|
||||
}
|
Reference in a new issue