當前位置: 首頁>>代碼示例>>Java>>正文


Java Logger類代碼示例

本文整理匯總了Java中com.google.android.gms.analytics.Logger的典型用法代碼示例。如果您正苦於以下問題:Java Logger類的具體用法?Java Logger怎麽用?Java Logger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Logger類屬於com.google.android.gms.analytics包,在下文中一共展示了Logger類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public static void initGATracker(DroidPlannerApp app) {
	if (sAppTracker == null) {
		final Context context = app.getApplicationContext();

		final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

		// Call is needed for now to allow dispatching of auto activity reports
		// (http://stackoverflow.com/a/23256722/1088814)
		analytics.enableAutoActivityReports(app);

		analytics.setAppOptOut(!DroidPlannerPrefs.getInstance(context).isUsageStatisticsEnabled());

		// If we're in debug mode, set log level to verbose.
		if (BuildConfig.DEBUG) {
			analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
		}

		sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
	}
}
 
開發者ID:mxiao6,項目名稱:Tower-develop,代碼行數:21,代碼來源:GAUtils.java

示例2: initGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public static void initGATracker(DroidPlannerApp app) {
	if (sAppTracker == null) {
		final Context context = app.getApplicationContext();

		final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

		// Call is needed for now to allow dispatching of auto activity
		// reports
		// (http://stackoverflow.com/a/23256722/1088814)
		analytics.enableAutoActivityReports(app);

		analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

		// If we're in debug mode, set log level to verbose.
		if (BuildConfig.DEBUG) {
			analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
		}

		sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
	}
}
 
開發者ID:jiaminghan,項目名稱:droidplanner-master,代碼行數:22,代碼來源:GAUtils.java

示例3: initGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
 
開發者ID:jiaminghan,項目名稱:droidplanner-master,代碼行數:21,代碼來源:GAUtils.java

示例4: initGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public static void initGATracker(DroidPlannerApp app) {
	if (sAppTracker == null) {
		final Context context = app.getApplicationContext();

		final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

		// Call is needed for now to allow dispatching of auto activity reports
		// (http://stackoverflow.com/a/23256722/1088814)
		analytics.enableAutoActivityReports(app);

		analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

		// If we're in debug mode, set log level to verbose.
		if (BuildConfig.DEBUG) {
			analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
		}

		sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
	}
}
 
開發者ID:sommishra,項目名稱:DroidPlanner-Tower,代碼行數:21,代碼來源:GAUtils.java

示例5: getTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

        /*Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                R.xml.global_tracker)
                : analytics.newTracker(Constants.GOOGLE_ANALYTICS_TRACKING_ID);*/
        Tracker t = analytics.newTracker(Constants.GOOGLE_ANALYTICS_TRACKING_ID);

        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
 
開發者ID:xxing1982,項目名稱:EDU_SYZT,代碼行數:18,代碼來源:Analytics.java

示例6: getTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.setDryRun(false);
        analytics.getLogger().setLogLevel(Logger.LogLevel.INFO);
        analytics.setLocalDispatchPeriod(30);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker)
                : null;
        if (t != null) {
            t.enableAdvertisingIdCollection(false);
        }
        mTrackers.put(trackerId, t);

    }
    return mTrackers.get(trackerId);
}
 
開發者ID:project-manatee,項目名稱:manatee-android,代碼行數:18,代碼來源:MyApplication.java

示例7: getTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (mTrackers.containsKey(trackerId)) {
        return mTrackers.get(trackerId);
    }

    final GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
    analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

    final Tracker tracker;
    switch (trackerId) {
        case APP_TRACKER:
            tracker = analytics.newTracker(PROPERTY_ID);
            break;
        case GLOBAL_TRACKER:
            tracker = analytics.newTracker(R.xml.global_tracker);
            break;
        default:
            tracker = analytics.newTracker(R.xml.global_tracker);
            break;
    }
    tracker.enableAdvertisingIdCollection(true);
    mTrackers.put(trackerId, tracker);

    return tracker;
}
 
開發者ID:xda,項目名稱:XDA-One,代碼行數:26,代碼來源:OneApplication.java

示例8: initTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
/**
 * Initialize the tracker
 */
private void initTracker() {

    final Context context = BarterLiApplication.getStaticContext();

    if (!BuildConfig.REPORT_GOOGLE_ANALYTICS) {
        GoogleAnalytics.getInstance(context).setDryRun(true);
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(Logger.LogLevel.VERBOSE);
    } else {
        GoogleAnalytics.getInstance(context).setDryRun(false);
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(Logger.LogLevel.ERROR);
    }
    mApplicationTracker = GoogleAnalytics.getInstance(context)
            .newTracker(context.getString(R.string.ga_tracking_id));

    //We will track manually since we use Fragments
    mApplicationTracker.enableAutoActivityTracking(false);
    mApplicationTracker.setSessionTimeout(SESSION_TIMEOUT);

}
 
開發者ID:barterli,項目名稱:barterli_android,代碼行數:25,代碼來源:GoogleAnalyticsManager.java

示例9: initGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public static void initGATracker(DroidPlannerServicesApp app) {
	if (sAppTracker == null) {
		final Context context = app.getApplicationContext();

		final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

		// Call is needed for now to allow dispatching of auto activity
		// reports
		// (http://stackoverflow.com/a/23256722/1088814)
		analytics.enableAutoActivityReports(app);

		analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

		// If we're in debug mode, set log level to verbose.
		if (BuildConfig.DEBUG) {
			analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
		}

		sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
	}
}
 
開發者ID:ne0fhyk,項目名稱:3DRServices,代碼行數:22,代碼來源:GAUtils.java

示例10: initializeGATracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public void initializeGATracker() {

        // Set dryRun flag.
        GoogleAnalytics.getInstance(context).setDryRun(GA_IS_DRY_RUN);

        // Set the log level to verbose if dryRun.
        // DEFAULT is set to DRY RUN (only logging will happen)
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(GA_IS_DRY_RUN ? Logger.LogLevel.VERBOSE : Logger.LogLevel.WARNING);

        // Set the opt out flag when user updates a tracking preference.
        /*
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
        sp.registerOnSharedPreferenceChangeListener(
                new SharedPreferences.OnSharedPreferenceChangeListener() {
                    @Override
                    public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
                        if (key.equals(TRACKING_PREF_KEY)) {
                            GoogleAnalytics.getInstance(getApplicationContext()).setAppOptOut(
                                    pref.getBoolean(key, false));
                        }
                    }
                });
                */
    }
 
開發者ID:Shahul3D,項目名稱:IndiaSatelliteWeather,代碼行數:26,代碼來源:AnalyticsUtil.java

示例11: init

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public void init(final Context context){
	if (tracker==null) {
           if (context==null){
               throw new IllegalArgumentException("No context set.");
           }
		// Create new tracker
		final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
		analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
		tracker = analytics.newTracker(R.xml.analytics);
	}
}
 
開發者ID:videgro,項目名稱:Ships,代碼行數:12,代碼來源:Analytics.java

示例12: getTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                R.xml.global_tracker)
                : analytics.newTracker(R.xml.ecommerce_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
 
開發者ID:DuongNTdev,項目名稱:StudyMovie,代碼行數:15,代碼來源:LEApplication.java

示例13: getDefaultTracker

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
/**
 * Get the default {@link Tracker} for this {@link Application}.
 *
 * @return tracker
 */
public static synchronized Tracker getDefaultTracker(Context context) {
    if (mTracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics
                .getInstance(context.getApplicationContext());
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        mTracker = analytics.newTracker(R.xml.global_tracker);
    }
    return mTracker;
}
 
開發者ID:googlearchive,項目名稱:friendlyping,代碼行數:15,代碼來源:AnalyticsHelper.java

示例14: setupAnalyticsTools

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
private void setupAnalyticsTools() {
    boolean isProd = !BuildConfig.DEBUG && BuildConfig.FLAVOR.equals("prod");

    // setup fabric
    Crashlytics crashlytics = new Crashlytics.Builder().disabled(!isProd).build();
    final Fabric fabric = new Fabric.Builder(this)
            .kits(crashlytics)
            .build();
    Fabric.with(fabric);

    // set up timber
    Timber.plant(isProd ? new CrashlyticsTree() : new Timber.DebugTree());

    // set up analytics
    GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
    SharedPreferences userPrefs = PreferenceManager.getDefaultSharedPreferences(this);

    analytics.setAppOptOut(!userPrefs.getBoolean(getString(R.string.key_analytics), true));
    analytics.getLogger().setLogLevel(Logger.LogLevel.ERROR);
    analytics.setDryRun(!isProd);

    userPrefs.registerOnSharedPreferenceChangeListener(new SharedPreferences.OnSharedPreferenceChangeListener() {
        @Override
        public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
            if (key.equals(getString(R.string.key_analytics))) {
                GoogleAnalytics.getInstance(getApplicationContext()).setAppOptOut(!sharedPreferences.getBoolean(key, true));
            }
        }
    });
}
 
開發者ID:AndrewJack,項目名稱:moment-for-android-wear,代碼行數:31,代碼來源:MomentApp.java

示例15: AnalyticsTrackers

import com.google.android.gms.analytics.Logger; //導入依賴的package包/類
/**
 * Don't instantiate directly - use {@link #getInstance()} instead.
 */
private AnalyticsTrackers(Context context) {
    Context mContext = context.getApplicationContext();
    GoogleAnalytics.getInstance(mContext).setDryRun(mContext.getResources().getBoolean(R.bool.ga_dryRun));
    GoogleAnalytics.getInstance(mContext).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
    mTracker = GoogleAnalytics.getInstance(mContext).newTracker(mContext.getString(R.string.ga_trackingId));
    mTracker.setSessionTimeout(300);
    mTracker.setAppVersion(BuildConfig.VERSION_NAME);
    mTracker.setAppId(BuildConfig.APPLICATION_ID);
}
 
開發者ID:SIGLUS,項目名稱:lmis-moz-mobile,代碼行數:13,代碼來源:AnalyticsTrackers.java


注:本文中的com.google.android.gms.analytics.Logger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。