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);
}
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.");
}
}
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);
}
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);
}
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);
}
}
Aggregations