diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/helper/ExceptionHelper.java b/li.strolch.utils/src/main/java/li/strolch/utils/helper/ExceptionHelper.java index 5c0c0371f..7957f9224 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/helper/ExceptionHelper.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/helper/ExceptionHelper.java @@ -29,6 +29,16 @@ import li.strolch.utils.RemoveCRFilterWriter; */ 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(); + } + /** *

* Returns a message for the given {@link Throwable}