Search in sources :

Example 16 with Logger

use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.

the class CrashlyticsController method writeSessionPartsToSessionFile.

private void writeSessionPartsToSessionFile(File sessionBeginFile, String sessionId, int maxLoggedExceptionsCount) {
    Logger logger = Logger.getLogger();
    logger.d("Collecting session parts for ID " + sessionId);
    File[] fatalFiles = listFilesMatching(new FileNameContainsFilter(sessionId + SESSION_FATAL_TAG));
    boolean hasFatal = fatalFiles != null && fatalFiles.length > 0;
    Logger.getLogger().d(String.format(Locale.US, "Session %s has fatal exception: %s", sessionId, Boolean.valueOf(hasFatal)));
    File[] nonFatalFiles = listFilesMatching(new FileNameContainsFilter(sessionId + SESSION_NON_FATAL_TAG));
    boolean hasNonFatal = nonFatalFiles != null && nonFatalFiles.length > 0;
    Logger.getLogger().d(String.format(Locale.US, "Session %s has non-fatal exceptions: %s", sessionId, Boolean.valueOf(hasNonFatal)));
    if (hasFatal || hasNonFatal) {
        File[] trimmedNonFatalFiles = getTrimmedNonFatalFiles(sessionId, nonFatalFiles, maxLoggedExceptionsCount);
        File fatalFile = hasFatal ? fatalFiles[0] : null;
        synthesizeSessionFile(sessionBeginFile, sessionId, trimmedNonFatalFiles, fatalFile);
    } else {
        Logger logger2 = Logger.getLogger();
        logger2.d("No events present for session ID " + sessionId);
    }
    Logger logger3 = Logger.getLogger();
    logger3.d("Removing session part files for ID " + sessionId);
    deleteSessionPartFilesFor(sessionId);
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger) File(java.io.File)

Example 17 with Logger

use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.

the class CrashlyticsController method writeToCosFromFile.

private static void writeToCosFromFile(CodedOutputStream cos, File file) throws IOException {
    if (!file.exists()) {
        Logger logger = Logger.getLogger();
        logger.e("Tried to include a file that doesn't exist: " + file.getName());
        return;
    }
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(file);
        copyToCodedOutputStream(fis, cos, (int) file.length());
    } finally {
        CommonUtils.closeOrLog(fis, "Failed to close file input stream.");
    }
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger) FileInputStream(java.io.FileInputStream)

Example 18 with Logger

use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.

the class CrashlyticsController method registerAnalyticsListener.

/* JADX INFO: Access modifiers changed from: package-private */
public void registerAnalyticsListener() {
    boolean analyticsRegistered = this.analyticsReceiver.register();
    Logger logger = Logger.getLogger();
    logger.d("Registered Firebase Analytics event listener for breadcrumbs: " + analyticsRegistered);
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger)

Example 19 with Logger

use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.

the class CrashlyticsController method doOpenSession.

/* JADX INFO: Access modifiers changed from: private */
public void doOpenSession() throws Exception {
    long startedAtSeconds = getCurrentTimestampSeconds();
    String sessionIdentifier = new CLSUUID(this.idManager).toString();
    Logger logger = Logger.getLogger();
    logger.d("Opening a new session with ID " + sessionIdentifier);
    this.nativeComponent.openSession(sessionIdentifier);
    writeBeginSession(sessionIdentifier, startedAtSeconds);
    writeSessionApp(sessionIdentifier);
    writeSessionOS(sessionIdentifier);
    writeSessionDevice(sessionIdentifier);
    this.logFileManager.setCurrentSession(sessionIdentifier);
    this.reportingCoordinator.onBeginSession(makeFirebaseSessionIdentifier(sessionIdentifier), startedAtSeconds);
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger)

Example 20 with Logger

use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.

the class CrashlyticsCore method onPreExecute.

public boolean onPreExecute(SettingsDataProvider settingsProvider) {
    Exception e;
    boolean initializeSynchronously;
    String mappingFileId = CommonUtils.getMappingFileId(this.context);
    Logger logger = Logger.getLogger();
    logger.d("Mapping file ID is: " + mappingFileId);
    boolean requiresBuildId = CommonUtils.getBooleanResourceValue(this.context, CRASHLYTICS_REQUIRE_BUILD_ID, CRASHLYTICS_REQUIRE_BUILD_ID_DEFAULT);
    if (isBuildIdValid(mappingFileId, requiresBuildId)) {
        String googleAppId = this.app.getOptions().getApplicationId();
        try {
            Logger logger2 = Logger.getLogger();
            logger2.i("Initializing Crashlytics " + getVersion());
            FileStore fileStore = new FileStoreImpl(this.context);
            this.crashMarker = new CrashlyticsFileMarker(CRASH_MARKER_FILE_NAME, fileStore);
            this.initializationMarker = new CrashlyticsFileMarker(INITIALIZATION_MARKER_FILE_NAME, fileStore);
            HttpRequestFactory httpRequestFactory = new HttpRequestFactory();
            AppData appData = AppData.create(this.context, this.idManager, googleAppId, mappingFileId);
            UnityVersionProvider unityVersionProvider = new ResourceUnityVersionProvider(this.context);
            AnalyticsReceiver analyticsReceiver = new AnalyticsConnectorReceiver(this.analyticsConnector, new // from class: com.google.firebase.crashlytics.internal.common.CrashlyticsCore.1
            AnalyticsConnectorReceiver.BreadcrumbHandler() {

                // com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver.BreadcrumbHandler
                @Override
                public void dropBreadcrumb(String breadcrumb) {
                    CrashlyticsCore.this.log(breadcrumb);
                }
            });
            Logger logger3 = Logger.getLogger();
            logger3.d("Installer package name is: " + appData.installerPackageName);
            this.controller = new CrashlyticsController(this.context, this.backgroundWorker, httpRequestFactory, this.idManager, this.dataCollectionArbiter, fileStore, this.crashMarker, appData, null, null, this.nativeComponent, unityVersionProvider, analyticsReceiver, this.analyticsConnector, settingsProvider);
            initializeSynchronously = didPreviousInitializationFail();
            checkForPreviousCrash();
        } catch (Exception e2) {
            e = e2;
        }
        try {
            this.controller.enableExceptionHandling(Thread.getDefaultUncaughtExceptionHandler(), settingsProvider);
            if (!initializeSynchronously || !CommonUtils.canTryConnection(this.context)) {
                Logger.getLogger().d("Exception handling initialization successful");
                return CRASHLYTICS_REQUIRE_BUILD_ID_DEFAULT;
            }
            Logger.getLogger().d("Crashlytics did not finish previous background initialization. Initializing synchronously.");
            finishInitSynchronously(settingsProvider);
            return false;
        } catch (Exception e3) {
            e = e3;
            Logger.getLogger().e("Crashlytics was not started due to an exception during initialization", e);
            this.controller = null;
            return false;
        }
    } else {
        throw new IllegalStateException(MISSING_BUILD_ID_MSG);
    }
}
Also used : HttpRequestFactory(com.google.firebase.crashlytics.internal.network.HttpRequestFactory) FileStoreImpl(com.google.firebase.crashlytics.internal.persistence.FileStoreImpl) Logger(com.google.firebase.crashlytics.internal.Logger) TimeoutException(java.util.concurrent.TimeoutException) ExecutionException(java.util.concurrent.ExecutionException) ResourceUnityVersionProvider(com.google.firebase.crashlytics.internal.unity.ResourceUnityVersionProvider) UnityVersionProvider(com.google.firebase.crashlytics.internal.unity.UnityVersionProvider) FileStore(com.google.firebase.crashlytics.internal.persistence.FileStore) ResourceUnityVersionProvider(com.google.firebase.crashlytics.internal.unity.ResourceUnityVersionProvider) AnalyticsConnectorReceiver(com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver) AnalyticsReceiver(com.google.firebase.crashlytics.internal.analytics.AnalyticsReceiver)

Aggregations

Logger (com.google.firebase.crashlytics.internal.Logger)33 IOException (java.io.IOException)12 File (java.io.File)10 CrashlyticsReport (com.google.firebase.crashlytics.internal.model.CrashlyticsReport)4 HttpRequest (com.google.firebase.crashlytics.internal.network.HttpRequest)4 HttpResponse (com.google.firebase.crashlytics.internal.network.HttpResponse)4 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 JSONObject (org.json.JSONObject)2 SharedPreferences (android.content.SharedPreferences)1 Bundle (android.os.Bundle)1 SuccessContinuation (com.google.android.gms.tasks.SuccessContinuation)1 Task (com.google.android.gms.tasks.Task)1 NativeSessionFileProvider (com.google.firebase.crashlytics.internal.NativeSessionFileProvider)1 AnalyticsConnectorReceiver (com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver)1 AnalyticsReceiver (com.google.firebase.crashlytics.internal.analytics.AnalyticsReceiver)1 CrashlyticsReportWithSessionId (com.google.firebase.crashlytics.internal.common.CrashlyticsReportWithSessionId)1 LogFileManager (com.google.firebase.crashlytics.internal.log.LogFileManager)1 HttpRequestFactory (com.google.firebase.crashlytics.internal.network.HttpRequestFactory)1 FileStore (com.google.firebase.crashlytics.internal.persistence.FileStore)1 FileStoreImpl (com.google.firebase.crashlytics.internal.persistence.FileStoreImpl)1