var traceTarget:TraceTarget = new TraceTarget();
// Log only messages for the classes in the mx.rpc.* and
// mx.messaging packages.
//traceTarget.filters=["mx.rpc.*","mx.messaging.*"];
// Log all log levels.
traceTarget.level = LogEventLevel.ALL;
// Add date, time, category, and log level to the output.
// This is a bug right now... you can't include both date and time.
traceTarget.includeDate = false;
traceTarget.includeTime = true;
traceTarget.includeCategory = true;
traceTarget.includeLevel = true;
traceTarget.filters = ["com.esria.logging"];
// Begin logging.
var logger:ILogger = Log.getLogger("com.esria.logging ");
traceTarget.addLogger(logger);
Log.addTarget(traceTarget);
var d:String = DateUtil.formatDate(new Date(), "MM/DD/YYY");
var x:XML = describeType(this);
var memberName:String = "undefined";
var members:XMLList = x.method.(@declaredBy==this.className);
for each(var member:XML in members) {
memberName = member.@name;
if (this[memberName] == arguments.callee)
break;
}
logger.debug("{0}.{1}", this.className, memberName);
Quick note... You should build a hasmap of each classes members that get returned by (x.method.(@declaredBy== this.className); ) if you plan on using it more than once to save looping over the classes variable names.
On 12/8/06, Derek Vadneau <
leadedsnow@...> wrote:
Funny, I just read that this morning. However, it doesn't really apply here. I need to pass a function object and the name will probably be different for each one. So assigning a value to a variable of the class isn't acceptable, since the value will change for each call.
As I mentioned, I have a workaround, but I really want to know whether the documentation is correct and I've simply missed something, or Adobe needs to clean up the docs.On 12/8/06, Anatole Tartakovsky < anatole.tartakovsky@... > wrote:Please see apply methodalso I posted pre-edited cut from the book here: http://flexblog.faratasystems.com/?p=125 - with closure object ala Flex 1.5 you can useThanks,Anatole
--
Derek Vadneau