Search in sources :

Example 1 with Logger

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

the class ReportUploader method uploadReport.

public boolean uploadReport(Report report, boolean dataCollectionToken) {
    try {
        CreateReportRequest requestData = new CreateReportRequest(this.organizationId, this.googleAppId, report);
        boolean shouldDeleteReport = true;
        if (this.dataTransportState == DataTransportState.ALL) {
            Logger.getLogger().d("Send to Reports Endpoint disabled. Removing Reports Endpoint report.");
        } else if (this.dataTransportState == DataTransportState.JAVA_ONLY && report.getType() == Report.Type.JAVA) {
            Logger.getLogger().d("Send to Reports Endpoint for non-native reports disabled. Removing Reports Uploader report.");
        } else {
            boolean sent = this.createReportCall.invoke(requestData, dataCollectionToken);
            Logger logger = Logger.getLogger();
            StringBuilder sb = new StringBuilder();
            sb.append("Crashlytics Reports Endpoint upload ");
            sb.append(sent ? "complete: " : "FAILED: ");
            sb.append(report.getIdentifier());
            logger.i(sb.toString());
            shouldDeleteReport = sent;
        }
        if (!shouldDeleteReport) {
            return false;
        }
        this.reportManager.deleteReport(report);
        return true;
    } catch (Exception e) {
        Logger logger2 = Logger.getLogger();
        logger2.e("Error occurred sending report " + report, e);
        return false;
    }
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger) CreateReportRequest(com.google.firebase.crashlytics.internal.report.model.CreateReportRequest)

Example 2 with Logger

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

the class SessionReportingCoordinator method onReportSendComplete.

/* JADX INFO: Access modifiers changed from: private */
public boolean onReportSendComplete(Task<CrashlyticsReportWithSessionId> task) {
    if (task.isSuccessful()) {
        CrashlyticsReportWithSessionId report = task.getResult();
        Logger logger = Logger.getLogger();
        logger.d("Crashlytics report successfully enqueued to DataTransport: " + report.getSessionId());
        this.reportPersistence.deleteFinalizedReport(report.getSessionId());
        return true;
    }
    Logger.getLogger().d("Crashlytics report could not be enqueued to DataTransport", task.getException());
    return false;
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger)

Example 3 with Logger

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

the class DefaultCreateReportSpiCall method invoke.

// com.google.firebase.crashlytics.internal.report.network.CreateReportSpiCall
@Override
public boolean invoke(CreateReportRequest requestData, boolean dataCollectionToken) {
    if (dataCollectionToken) {
        HttpRequest httpRequest = getHttpRequest();
        HttpRequest httpRequest2 = applyMultipartDataTo(applyHeadersTo(httpRequest, requestData), requestData.report);
        Logger logger = Logger.getLogger();
        logger.d("Sending report to: " + getUrl());
        try {
            HttpResponse httpResponse = httpRequest2.execute();
            int statusCode = httpResponse.code();
            Logger logger2 = Logger.getLogger();
            logger2.d("Create report request ID: " + httpResponse.header(AbstractSpiCall.HEADER_REQUEST_ID));
            Logger logger3 = Logger.getLogger();
            logger3.d("Result was: " + statusCode);
            return ResponseParser.parse(statusCode) == 0;
        } catch (IOException ioe) {
            Logger.getLogger().e("Create report HTTP request failed.", ioe);
            throw new RuntimeException(ioe);
        }
    } else {
        throw new RuntimeException("An invalid data collection token was used.");
    }
}
Also used : HttpRequest(com.google.firebase.crashlytics.internal.network.HttpRequest) HttpResponse(com.google.firebase.crashlytics.internal.network.HttpResponse) IOException(java.io.IOException) Logger(com.google.firebase.crashlytics.internal.Logger)

Example 4 with Logger

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

the class SettingsController method logSettings.

/* JADX INFO: Access modifiers changed from: private */
public void logSettings(JSONObject json, String message) throws JSONException {
    Logger logger = Logger.getLogger();
    logger.d(message + json.toString());
}
Also used : Logger(com.google.firebase.crashlytics.internal.Logger)

Example 5 with Logger

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

the class BinaryImagesConverter method jsonFromMapEntryString.

private JSONObject jsonFromMapEntryString(String mapEntryString) {
    ProcMapEntry mapInfo = ProcMapEntryParser.parse(mapEntryString);
    if (mapInfo == null || !isRelevant(mapInfo)) {
        return null;
    }
    String path = mapInfo.path;
    File binFile = getLibraryFile(path);
    try {
        String uuid = this.fileIdStrategy.createId(binFile);
        try {
            return createBinaryImageJson(uuid, mapInfo);
        } catch (JSONException e) {
            Logger.getLogger().d("Could not create a binary image json string", e);
            return null;
        }
    } catch (IOException e2) {
        Logger logger = Logger.getLogger();
        logger.d("Could not generate ID for file " + mapInfo.path, e2);
        return null;
    }
}
Also used : JSONException(org.json.JSONException) IOException(java.io.IOException) Logger(com.google.firebase.crashlytics.internal.Logger) File(java.io.File)

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