private void inferCallerELKI ( ) { needToInferCaller = false ; StackTraceElement [ ] stack = ( new Throwable ( ) ) . getStackTrace ( ) ; int ix = 0 ; // skip back to the logger. while ( ix < stack . length ) { StackTraceElement frame = stack [ ix ] ; final String cls = frame . getClassName ( ) ; if ( cls . equals ( START_TRACE_AT ) ) { break ; } ix ++ ; } // skip further back through helper functions while ( ix < stack . length ) { StackTraceElement frame = stack [ ix ] ; final String cls = frame . getClassName ( ) ; boolean ignore = false ; for ( int i = 0 ; i < IGNORE_CLASSES . length ; i ++ ) { if ( cls . equals ( IGNORE_CLASSES [ i ] ) ) { ignore = true ; break ; } } if ( ! ignore ) { super . setSourceClassName ( frame . getClassName ( ) ) ; super . setSourceMethodName ( frame . getMethodName ( ) ) ; break ; } ix ++ ; } }
Infer a caller ignoring logging - related classes .