package com.github.ymegane.android.dlog;

public class TagBuilder {
    boolean _package = false;

    public TagBuilder addPackage(boolean output) {
        _package = output;
        return this;
    }

    String tag(StackTraceElement stackTraceElement) {
        StringBuilder stringBuilder = new StringBuilder();

        String className = stackTraceElement.getClassName();
        String[] packages = className.split("\\.");

        if (_package) {
            for (int i=0; i<packages.length-2; i++) {
                stringBuilder.append(packages[i]);
            }
        }
        stringBuilder.append(packages[packages.length-1]);

        return stringBuilder.toString();
    }
}

@@ -466,125 +466,62 @@
     
-for (int i=0; i%3Cpackages.length-2; i++) %7B%0A                stringBuilder.append(packages%5Bi%5D);%0A            %7D%0A        %7D%0A
+stringBuilder.append(className);%0A        %7D else %7B%0A    
     
@@ -573,13 +573,25 @@
 ngth
--
+ - 
 1%5D);
+%0A        %7D
 %0A%0A  

Fix package option on TagBuilder