Introduction of Android Studio Shortcut Key Generating TAG Log. x Log Output

  • 2021-12-04 11:14:05
  • OfStack

Generate TAG

logt+Tab bond:

private static final String TAG = "Extract";

Generate Log. d ()

logd+Tab Bond:

Log.d(TAG, "onCreate: ");

Generate Log. e ()

loge+Tab Bond:

Log.e(TAG, "onCreate: ",new Throwable());

Generate Log. i/w similar

Log.i(TAG, "onCreate: ");
Log.w(TAG, "onCreate: ", );

logm+Tab: Print parameters

Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");

logr+Tab: Print return value

Log.d(TAG, "onCreate() returned: " + );

View log output

In the Android Studio Logcat tab, you can select the filtering level to filter log output, such as Verbose, Debug, Error, etc. The above options (such as Debug) will include the logs of the following options (such as Error)

Supplementary Knowledge: Android Studio Quick Completion Log and Generation of TAG

Outside the method, where the variable (constant) quantity is defined, enter logt, and then press Tab, which automatically generates an TAG constant with the current class name as the value.

Enter logd in the method, then press Tab, and one debug level log will be automatically completed, and so on for other levels.


Related articles: