I assume most of you are aware of android.util.Log All logging methods accept \'String tag\' as a first argument.
And my question is How do you usually tag y
AndroidStudio has a logt
template by default (you can type logt
and press tab to have it expand to a sinppet of code) . I recommend using this to avoid copy pasting the TAG definition from another class and forgetting to change the class you're referring to. The template expands by default to
private static final String TAG = "$CLASS_NAME$"
To avoid using the old class name after refactoring you could change that to
private static final String TAG = $CLASS_NAME$.class.getSimpleName();
Remember to check the "Edit variables" button and make sure that the CLASS_NAME
variable is defined to use the className()
Expression and has "Skip if defined" checked.