use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class CommonUtils method getTotalRamInBytes.
public static synchronized long getTotalRamInBytes() {
long bytes;
synchronized (CommonUtils.class) {
if (totalRamInBytes == -1) {
long bytes2 = 0;
String result = extractFieldFromSystemFile(new File("/proc/meminfo"), "MemTotal");
if (!TextUtils.isEmpty(result)) {
String result2 = result.toUpperCase(Locale.US);
try {
if (result2.endsWith("KB")) {
bytes2 = convertMemInfoToBytes(result2, "KB", 1024);
} else if (result2.endsWith("MB")) {
bytes2 = convertMemInfoToBytes(result2, "MB", 1048576);
} else if (result2.endsWith("GB")) {
bytes2 = convertMemInfoToBytes(result2, "GB", BYTES_IN_A_GIGABYTE);
} else {
Logger logger = Logger.getLogger();
logger.d("Unexpected meminfo format while computing RAM: " + result2);
}
} catch (NumberFormatException e) {
Logger logger2 = Logger.getLogger();
logger2.e("Unexpected meminfo format while computing RAM: " + result2, e);
}
}
totalRamInBytes = bytes2;
}
bytes = totalRamInBytes;
}
return bytes;
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class CrashlyticsReportPersistence method persistEvent.
public void persistEvent(CrashlyticsReport.Session.Event event, String sessionId, boolean isHighPriority) {
int maxEventsToKeep = this.settingsDataProvider.getSettings().getSessionData().maxCustomExceptionEvents;
File sessionDirectory = getSessionDirectoryById(sessionId);
String json = TRANSFORM.eventToJson(event);
String fileName = generateEventFilename(this.eventCounter.getAndIncrement(), isHighPriority);
try {
writeTextFile(new File(sessionDirectory, fileName), json);
} catch (IOException e) {
Logger logger = Logger.getLogger();
logger.d("Could not persist event for session " + sessionId, e);
}
trimEvents(sessionDirectory, maxEventsToKeep);
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class CrashlyticsReportPersistence method loadFinalizedReports.
public List<CrashlyticsReportWithSessionId> loadFinalizedReports() {
List<File> allReportFiles = getAllFinalizedReportFiles();
ArrayList<CrashlyticsReportWithSessionId> allReports = new ArrayList<>();
allReports.ensureCapacity(allReportFiles.size());
for (File reportFile : getAllFinalizedReportFiles()) {
try {
CrashlyticsReport jsonReport = TRANSFORM.reportFromJson(readTextFile(reportFile));
allReports.add(CrashlyticsReportWithSessionId.create(jsonReport, reportFile.getName()));
} catch (IOException e) {
Logger logger = Logger.getLogger();
logger.d("Could not load report file " + reportFile + "; deleting", e);
reportFile.delete();
}
}
return allReports;
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class ProcMapEntryParser method parse.
/* JADX INFO: Access modifiers changed from: package-private */
public static ProcMapEntry parse(String mapEntry) {
Matcher m = MAP_REGEX.matcher(mapEntry);
if (!m.matches()) {
return null;
}
try {
long address = Long.valueOf(m.group(1), 16).longValue();
long size = Long.valueOf(m.group(2), 16).longValue() - address;
String perms = m.group(3);
String path = m.group(4);
return new ProcMapEntry(address, size, perms, path);
} catch (Exception e) {
Logger logger = Logger.getLogger();
logger.d("Could not parse map entry: " + mapEntry);
return null;
}
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class SessionReport method remove.
// com.google.firebase.crashlytics.internal.report.model.Report
@Override
public void remove() {
Logger logger = Logger.getLogger();
logger.d("Removing report at " + this.file.getPath());
this.file.delete();
}
Aggregations