I'm playing with f2b3 new logging api and trying to use it in a similar way I'd use java.util.log
However if the category of the logger contains the ":" character an exception is thrown. Reviewing the code, I've seen in the Log class a function called hasIllegalCharacters() which explicitly prevents us from using a ":" character in the category name.
I think a really common log would be as follows:
----------------
[DEBUG] 5/19 23:05 -> com.code4net.log.TestLog
TestLog object created
----------------
But due to the syntax of the string returned by getQualifiedClassName() the category would be " com.code4net.log:TestLog".
Here's the code I'm playing with:
<code>
package com.code4net.rpc {
import mx.logging.Log;
import mx.logging.ILogger;
import flash.utils.getQualifiedClassName ;
import mx.logging.LogEventLevel;
public class TestLog {
private var log:ILogger = Log.getLogger(getQualifiedClassName(this).replace("::","."));
public function TestLog() {
log.log(LogEventLevel.DEBUG,"TestLog object created");
}
}
}
</code>
As shown in the code ":" can be replaced with "." but IMHO in large applications this could become an important performance issue.
Are category names restricted for some especial reason? Is there any other way to go?
Best
Xavi Beumala
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

