From d13e9a0c21282608229301d160553bb71cfa1a88 Mon Sep 17 00:00:00 2001 From: Nitser Date: Tue, 1 Oct 2019 16:59:52 +0300 Subject: [PATCH] add new method for onLyfecycleMethod string --- .../main/java/ru/touchin/roboswag/core/log/Lc.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/logging/src/main/java/ru/touchin/roboswag/core/log/Lc.java b/logging/src/main/java/ru/touchin/roboswag/core/log/Lc.java index 5bc99f7..e464f02 100644 --- a/logging/src/main/java/ru/touchin/roboswag/core/log/Lc.java +++ b/logging/src/main/java/ru/touchin/roboswag/core/log/Lc.java @@ -257,6 +257,20 @@ public final class Lc { + (caller != null ? " of object " + caller.getClass().getSimpleName() + '(' + Integer.toHexString(caller.hashCode()) + ')' : ""); } + /** + * Returns line of code from where this method called. + * + * @param caller Object who is calling for code point; + * @param methodName String represents lifecycle method in which it was called + * @return String represents code point. + */ + @Non + @NonNull + public static String getCodePoint(@Nullable final Object caller, final String methodName) { + return methodName + + (caller != null ? " of object " + caller.getClass().getSimpleName() + '(' + Integer.toHexString(caller.hashCode()) + ')' : ""); + } + /** * Prints stacktrace in log with specified tag. *