Hi,

I managed to get aspectj 1.1.1 to generate log4j 1.2.8 traces when methods get
called or they return.  Unfortunately, for some code (eg for 'before'
pointcuts) only the file name is available, thus looking like this:
...
  at foo.bar(Foo.java)
...

Generating location information like
[?: ?]

If file-only is 'legal' in Java I don't know, but looking at Java 1.4
java.lang.StackTraceElement it may well be
(http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StackTraceElement.html#getLineNumber()):

public int getLineNumber()
    ....
    Returns:
        the line number of the source line containing the execution
        point represented by this stack trace element, or a
        negative number if this information is unavailable.

Unfortunately, in log4j 1.2.8 LocationInfo#getFileName is not prepared for this,
as it always looks for ':'

int iend = fullInfo.lastIndexOf(':');
if(iend == -1)
   fileName = NA;
else {
   int ibegin = fullInfo.lastIndexOf('(', iend - 1);
   fileName = this.fullInfo.substring(ibegin + 1, iend);
}

I would like to see this changed to something more relaxed, to get
location information like [Foo.java: ?]

Any thoughts on that?

Best regards,
Ron
-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to