package gr.michalisvitos.timberutils;

import timber.log.Timber;

/**
 * A {@link timber.log.Timber.Tree Tree} for debug builds. This trees prints a tag in the
 * following format: className[threadName].methodName()#lineNumber
 * <p>
 * Created by Michalis Vitos on 21/11/2016.
 */
public class DebugTree extends Timber.DebugTree
{
	public DebugTree()
	{
		super();
	}

	@Override
	protected String createStackElementTag(StackTraceElement element)
	{
		return String.format("%s[%s].%s()#%s",
		  super.createStackElementTag(element),
		  Thread.currentThread().getName(),
		  element.getMethodName(),
		  element.getLineNumber()
		);
	}

}

@@ -363,17 +363,18 @@
 ();%0A%09%7D%0A%0A
-%09
+  
 @Overrid
@@ -375,17 +375,18 @@
 verride%0A
-%09
+  
 protecte
@@ -447,55 +447,46 @@
 nt)%0A
-%09%7B%0A%09%09return String.format(%22%25s%5B%25s%5D.%25s()#%25s%22,%0A%09%09 
+  %7B%0A    final String stackElementTag =
  sup
@@ -518,21 +518,47 @@
 element)
-,%0A%09%09 
+;%0A    final String threadName =
  Thread.
@@ -586,74 +586,331 @@
 me()
-,%0A%09%09  element.getMethodName(),%0A%09%09  element.getLineNumber()%0A%09%09);%0A%09%7D%0A
+;%0A    final int lineNumber = element.getLineNumber();%0A    String methodName = element.getMethodName();%0A    if (methodName.contains(%22%5C%5C$%22))%0A      methodName = methodName.split(%22%5C%5C$%22)%5B0%5D;%0A%0A    return String.format(%22%25s%5B%25s%5D.%25s()#%25s%22,%0A        stackElementTag,%0A        threadName,%0A        methodName,%0A        lineNumber%0A    );%0A  %7D
 %0A%7D%0A

Edit DebugTree to handle lamda functions