Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb6e35d7 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa Committed by Android (Google) Code Review
Browse files

Merge "Suppress too verbose logging"

parents 2b3ee0f3 b5c9f63a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.contacts.util.Constants;
import com.google.common.annotations.VisibleForTesting;

import android.app.Application;
import android.app.FragmentManager;
import android.app.LoaderManager;
import android.content.ContentResolver;
import android.content.Context;
@@ -109,10 +110,14 @@ public final class ContactsApplication extends Application {
        Context context = getApplicationContext();
        PreferenceManager.getDefaultSharedPreferences(context);
        AccountTypeManager.getInstance(context);
        LoaderManager.enableDebugLogging(true);

        LoaderManager.enableDebugLogging(Log.isLoggable(Constants.LOADER_MANAGER_TAG, Log.DEBUG));
        FragmentManager.enableDebugLogging(
                Log.isLoggable(Constants.FRAGMENT_MANAGER_TAG, Log.DEBUG));
        if (Log.isLoggable(Constants.STRICT_MODE_TAG, Log.DEBUG)) {
            StrictMode.setThreadPolicy(
                    new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
        }

        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
            Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate finish");
+22 −2
Original line number Diff line number Diff line
@@ -25,7 +25,27 @@ public class Constants {
    public static final String SCHEME_IMTO = "imto";
    public static final String SCHEME_SIP = "sip";

    // Log tag for performance measurement.
    // To enable: adb shell setprop log.tag.ContactsPerf VERBOSE
    /**
     * Log tag for performance measurement.
     * To enable: adb shell setprop log.tag.ContactsPerf VERBOSE
     */
    public static final String PERFORMANCE_TAG = "ContactsPerf";

    /**
     * Log tag for enabling/disabling LoaderManager log.
     * To enable: adb shell setprop log.tag.ContactsLoaderManager DEBUG
     */
    public static final String LOADER_MANAGER_TAG = "ContactsLoaderManager";

    /**
     * Log tag for enabling/disabling FragmentManager log.
     * To enable: adb shell setprop log.tag.ContactsFragmentManager DEBUG
     */
    public static final String FRAGMENT_MANAGER_TAG = "ContactsFragmentManager";

    /**
     * Log tag for enabling/disabling StrictMode violation log.
     * To enable: adb shell setprop log.tag.ContactsStrictMode DEBUG
     */
    public static final String STRICT_MODE_TAG = "ContactsStrictMode";
}