Search in sources :

Example 1 with CustomPropertiesLogFactory

use of com.microsoft.appcenter.ingestion.models.json.CustomPropertiesLogFactory in project mobile-center-sdk-android by Microsoft.

the class AppCenter method finishConfiguration.

@WorkerThread
private void finishConfiguration() {
    /* Load some global constants. */
    Constants.loadFromContext(mApplication);
    /* If parameters are valid, init context related resources. */
    StorageHelper.initialize(mApplication);
    /* Initialize session storage. */
    SessionContext.getInstance();
    /* Get enabled state. */
    boolean enabled = isInstanceEnabled();
    /* Init uncaught exception handler. */
    mUncaughtExceptionHandler = new UncaughtExceptionHandler();
    if (enabled) {
        mUncaughtExceptionHandler.register();
    }
    /* Init channel. */
    mLogSerializer = new DefaultLogSerializer();
    mLogSerializer.addLogFactory(StartServiceLog.TYPE, new StartServiceLogFactory());
    mLogSerializer.addLogFactory(CustomPropertiesLog.TYPE, new CustomPropertiesLogFactory());
    mChannel = new DefaultChannel(mApplication, mAppSecret, mLogSerializer, mHandler);
    mChannel.setEnabled(enabled);
    mChannel.addGroup(CORE_GROUP, DEFAULT_TRIGGER_COUNT, DEFAULT_TRIGGER_INTERVAL, DEFAULT_TRIGGER_MAX_PARALLEL_REQUESTS, null);
    if (mLogUrl != null) {
        mChannel.setLogUrl(mLogUrl);
    }
    if (!enabled) {
        NetworkStateHelper.getSharedInstance(mApplication).close();
    }
    AppCenterLog.debug(LOG_TAG, "App Center storage initialized.");
}
Also used : StartServiceLogFactory(com.microsoft.appcenter.ingestion.models.json.StartServiceLogFactory) CustomPropertiesLogFactory(com.microsoft.appcenter.ingestion.models.json.CustomPropertiesLogFactory) DefaultChannel(com.microsoft.appcenter.channel.DefaultChannel) DefaultLogSerializer(com.microsoft.appcenter.ingestion.models.json.DefaultLogSerializer) WorkerThread(android.support.annotation.WorkerThread)

Aggregations

WorkerThread (android.support.annotation.WorkerThread)1 DefaultChannel (com.microsoft.appcenter.channel.DefaultChannel)1 CustomPropertiesLogFactory (com.microsoft.appcenter.ingestion.models.json.CustomPropertiesLogFactory)1 DefaultLogSerializer (com.microsoft.appcenter.ingestion.models.json.DefaultLogSerializer)1 StartServiceLogFactory (com.microsoft.appcenter.ingestion.models.json.StartServiceLogFactory)1