Log generator

Compatible with: IntelliJ IDEA Android Studio
Jul 21, 2016
532

Generate log methods from class fields.

    Its good for model class.
    Default log class is Android.Log.
    Plugin generate debugTag from "foo.class.getName()";
    Is possible set log class on plugin settings.
    Example settings: timber.log.Timber;

    Use:click right in class -> generate -> DebugLog
    Shortcut: ctrl+shift+L.
    Choose fields to log and choose level log.

    Only for Android studio. Im working on others.
Example:

 model class before generate:

 package sk.bigfootindie.loscocos;

 public class Foo {
        private String name;
        private String city;
        private int age;
   }

 model class after generate:

 package sk.bigfootindie.loscocos;

 import android.util.Log;

 public class Foo {
        private static final String debugTag = Foo.class.getName();
        private String name;
        private String city;
        private int age;

        public void printToDebugLog() {
            if (BuildConfig.DEBUG) {
                Log.i(debugTag, "name = " + name);
                Log.i(debugTag, "city = " + city);
                Log.i(debugTag, "age = " + age);
               }
        }
  }

Download plugin

Recent change notes

beta early version 0.3