Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int depth =trace.length;
- String module="java.base";
- while(!module.equals(trace[--depth].getModuleName())) ;//get out of system.out/err
- depth++;
- while(trace[depth].getClassName().equals(LogUtil.class.getName())) depth++;//get out of LogUtil if called called trough it
- StackTraceElement stack =trace[depth];
- byte[] threadBytes=Thread.currentThread().getName().getBytes(), pointerBytes;
- if(CLICKABLE) pointerBytes=stack.toString().getBytes();
- else{
- String className=stack.getClassName();
- pointerBytes=(className.substring(className.lastIndexOf('.')+1)+'.'+stack.getMethodName()+'('+stack.getLineNumber()+')').getBytes();
- }
Add Comment
Please, Sign In to add comment