Recent items online A bug that reported that the encryption control was entered as empty, because the ios,android,web side is reported, But did not find the reason, because it is even now, so in order to catch this problem, we have to send the error message to the backstage, so write a method to obtain.
1. Get method Name:
public static String Getcurrentmethodname () {
int level = 1;
stacktraceelement[] Stacks = new throwable (). Getstacktrace () String MethodName = Stacks[level].getmethodname () return methodname}
2. Get the class name:
public static String getcurrentclassname () {
Span style= "COLOR: #cc7832" >int level = 1 stacktraceelement[] Stacks = new throwable (). Getstacktrace () String ClassName = Stacks[level].getclassname () return classname}
3. Get line number:
public static int getlinenumber () {
int level = 1 stacktraceelement[] Stacks = new throwable (). Getstacktrace () int linenumber = Stacks[level].getlinenumber () return linenumber}
Gets the current run code class name, line number, method name in Java