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

Commit b5c9f63a authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Suppress too verbose logging

Bug: 5345778
Change-Id: I00b87523632993ae6462fde6606a315d565e7092
parent 73857f4e
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";
}