[New] Added ExceptionHelper.getCallerMethod()
This commit is contained in:
parent
102e3524fb
commit
6adb3bf2c1
|
@ -29,6 +29,16 @@ import li.strolch.utils.RemoveCRFilterWriter;
|
||||||
*/
|
*/
|
||||||
public class ExceptionHelper {
|
public class ExceptionHelper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the class name and method name of the caller
|
||||||
|
*
|
||||||
|
* @return the class name and method name of the caller
|
||||||
|
*/
|
||||||
|
public static String getCallerMethod() {
|
||||||
|
StackTraceElement element = new Throwable().getStackTrace()[1];
|
||||||
|
return element.getClassName() + "." + element.getMethodName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Returns a message for the given {@link Throwable}
|
* Returns a message for the given {@link Throwable}
|
||||||
|
|
Loading…
Reference in New Issue