if (Parse.LOG_LEVEL_INFO >= Parse.getLogLevel()) { log.info("Parse command cache has started processing queued commands."); if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "saveEventually thread had an error.", e); runningLock.notifyAll(); if (Parse.LOG_LEVEL_INFO >= Parse.getLogLevel()) { log.info("saveEventually thread has stopped processing commands.");
json = jsonObject.toString().getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { if (Parse.LOG_LEVEL_WARNING >= Parse.getLogLevel()) { log.log(Level.WARNING, "UTF-8 isn't supported. This shouldn't happen.", e); if (Parse.LOG_LEVEL_WARNING >= Parse.getLogLevel()) { log.warning("Unable to save command for later because it's too big."); if (size > maxCacheSizeBytes) { if (preferOldest) { if (Parse.LOG_LEVEL_WARNING >= Parse.getLogLevel()) { log.warning("Unable to save command for later because storage is full."); if (Parse.LOG_LEVEL_WARNING >= Parse.getLogLevel()) { log.warning("Deleting old commands to make room in command cache."); if (Parse.LOG_LEVEL_WARNING >= Parse.getLogLevel()) { log.log(Level.WARNING, "Unable to save command for later.", e);
} catch (FileNotFoundException e) { if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "File disappeared from cache while being read.", e); if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "Unable to read contents of file in cache.", e); continue; } catch (JSONException e) { if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "Error parsing JSON found in cache.", e); command = commandFromJSON(json); } catch (JSONException e) { if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "Unable to create ParseCommand from JSON.", e); if (Parse.LOG_LEVEL_INFO >= Parse.getLogLevel()) { log.info("Network timeout in command cache. Waiting for " + timeoutRetryWaitSeconds + " seconds and then retrying " + retriesRemaining + " times."); if (Parse.LOG_LEVEL_INFO >= Parse.getLogLevel()) { log.info("Aborting wait because runEventually thread should stop."); if (Parse.LOG_LEVEL_ERROR >= Parse.getLogLevel()) { log.log(Level.SEVERE, "Failed to run command.", e);
private void debugLog(String message) { if (Parse.getLogLevel() <= Parse.LOG_LEVEL_DEBUG && Log.isLoggable(LOG_TAG, Log.DEBUG)) { Log.d(LOG_TAG, message); } } }
protected void debugLog(String text) { if (Parse.getLogLevel() <= Parse.LOG_LEVEL_DEBUG && Log.isLoggable(getLogTag(), Log.WARN)) { Log.w(getLogTag(), text); } }
private Bundle getMergedOptions() { // Read activity metadata from AndroidManifest.xml ActivityInfo activityInfo = null; try { activityInfo = getPackageManager().getActivityInfo( this.getComponentName(), PackageManager.GET_META_DATA); } catch (NameNotFoundException e) { if (Parse.getLogLevel() <= Parse.LOG_LEVEL_ERROR && Log.isLoggable(LOG_TAG, Log.WARN)) { Log.w(LOG_TAG, e.getMessage()); } } // The options specified in the Intent (from ParseLoginBuilder) will // override any duplicate options specified in the activity metadata Bundle mergedOptions = new Bundle(); if (activityInfo != null && activityInfo.metaData != null) { mergedOptions.putAll(activityInfo.metaData); } if (getIntent().getExtras() != null) { mergedOptions.putAll(getIntent().getExtras()); } return mergedOptions; } }
bundle.getInt(FACEBOOK_LOGIN_PERMISSIONS)))); } catch (NotFoundException e) { if (Parse.getLogLevel() <= Parse.LOG_LEVEL_ERROR) { Log.w(LOG_TAG, "Facebook permission string array resource not found");