This inferCaller() isn't used, but let's at least format it with spaces instead of tabs.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2710 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -82,22 +82,22 @@ public class JDK14Logger implements Logger.Factory
|
||||
String self = getClass().getName();
|
||||
|
||||
// locate ourselves in the call stack
|
||||
StackTraceElement[] stack = (new Throwable()).getStackTrace();
|
||||
StackTraceElement[] stack = (new Throwable()).getStackTrace();
|
||||
int ii = 0;
|
||||
for (; ii < stack.length; ii++) {
|
||||
if (self.equals(stack[ii].getClassName())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (self.equals(stack[ii].getClassName())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
System.err.println("Found self at " + ii);
|
||||
// now locate the first thing that's not us, that's the caller
|
||||
for (; ii < stack.length; ii++) {
|
||||
String cname = stack[ii].getClassName();
|
||||
if (!cname.equals(self)) {
|
||||
for (; ii < stack.length; ii++) {
|
||||
String cname = stack[ii].getClassName();
|
||||
if (!cname.equals(self)) {
|
||||
System.err.println("Found non-self at " + ii + " " + cname);
|
||||
return new String[] { cname, stack[ii].getMethodName() };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.err.println("Failed to find non-self.");
|
||||
return new String[] { null, null };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user