private static final String [ ] inferCaller ( ) { StackTraceElement [ ] stack = ( new Throwable ( ) ) . getStackTrace ( ) ; int ix = 0 ; while ( ix < stack . length ) { StackTraceElement frame = stack [ ix ] ; if ( ! frame . getClassName ( ) . equals ( LoggingUtil . class . getCanonicalName ( ) ) ) { return new String [ ] { frame . getClassName ( ) , frame . getMethodName ( ) } ; } ix ++ ; } return null ; }
Infer which class has called the logging helper .