List of usage examples for android.util Log VERBOSE
int VERBOSE
To view the source code for android.util Log VERBOSE.
Click Source Link
From source file:com.googlecode.eyesfree.brailleback.BrailleIME.java
@Override public void onCreate() { super.onCreate(); sInstance = new WeakReference<BrailleIME>(this); mInputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); LogUtils.log(this, Log.VERBOSE, "Created Braille IME"); Host host = getHost();//from www. j a v a 2 s . c om if (host != null) { host.onCreateIME(); } }
From source file:ir.keloud.android.lib.common.SingleSessionManager.java
@Override public KeloudClient removeClientFor(KeloudAccount account) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log_OC.d(TAG, "removeClientFor starting "); }/* w w w . j ava2s. c om*/ if (account == null) { return null; } KeloudClient client = null; String accountName = account.getName(); if (accountName != null) { client = mClientsWithKnownUsername.remove(accountName); if (client != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log_OC.v(TAG, "Removed client for account " + accountName); } return client; } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log_OC.v(TAG, "No client tracked for account " + accountName); } } } mClientsWithUnknownUsername.clear(); if (Log.isLoggable(TAG, Log.DEBUG)) { Log_OC.d(TAG, "removeClientFor finishing "); } return null; }
From source file:com.cerema.cloud2.lib.common.SingleSessionManager.java
@Override public OwnCloudClient removeClientFor(OwnCloudAccount account) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log_OC.d(TAG, "removeClientFor starting "); }//from w w w . j a v a 2 s.c om if (account == null) { return null; } OwnCloudClient client = null; String accountName = account.getName(); if (accountName != null) { client = mClientsWithKnownUsername.remove(accountName); if (client != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log_OC.v(TAG, "Removed client for account " + accountName); } return client; } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log_OC.v(TAG, "No client tracked for account " + accountName); } } } mClientsWithUnknownUsername.clear(); if (Log.isLoggable(TAG, Log.DEBUG)) { Log_OC.d(TAG, "removeClientFor finishing "); } return null; }
From source file:org.readium.sdk.lcp.StatusDocumentProcessing.java
public void start(IListener statusDocumentProcessingListener) { m_statusDocumentProcessingListener = statusDocumentProcessingListener; final String url = mLicense.getLink_Status(); // An alternative method to configure Ion requests: ////from w w w .ja va 2 s.c o m // final AsyncHttpRequestFactory current = Ion.getDefault(context).configure().getAsyncHttpRequestFactory(); // Ion.getDefault(context).configure().setAsyncHttpRequestFactory(new AsyncHttpRequestFactory() { // @Override // public AsyncHttpRequest createAsyncHttpRequest(Uri uri, String method, Headers headers) { // AsyncHttpRequest ret = current.createAsyncHttpRequest(uri, method, headers); // ret.setTimeout(1000); // return ret; // } // }); Locale currentLocale = getCurrentLocale(); String langCode = currentLocale.toString().replace('_', '-'); langCode = langCode + ",en-US;q=0.7,en;q=0.5"; Future<Response<InputStream>> request = Ion.with(m_context).load("GET", url) .setLogging("Readium Ion", Log.VERBOSE) //.setTimeout(AsyncHttpRequest.DEFAULT_TIMEOUT) //30000 .setTimeout(6000) // TODO: comment this in production! (this is only for testing a local HTTP server) //.setHeader("X-Add-Delay", "2s") // LCP / LSD server with message localization .setHeader("Accept-Language", langCode) .asInputStream().withResponse() // UI thread .setCallback(new FutureCallback<Response<InputStream>>() { @Override public void onCompleted(Exception e, Response<InputStream> response) { InputStream inputStream = response != null ? response.getResult() : null; int httpResponseCode = response != null ? response.getHeaders().code() : 0; if (e != null || inputStream == null || httpResponseCode < 200 || httpResponseCode >= 300) { if (!m_wasCancelled) { m_statusDocumentProcessingListener.onStatusDocumentProcessingComplete(); } return; } try { // alternative methods for checking response payload // int length = 0; // try { // String strLength = response.getHeaders().getHeaders().get("Content-Length"); // length = Integer.parseInt(strLength); // } catch(Exception exc){ // // ignore // } // if (length == 0) { // length = inputStream.available(); // length = 20*1024; // TODO: 20kB max okay? // } // // byte[] buffer = new byte[length]; // int bytesRead = inputStream.read(buffer, 0, length); // String json = new String(buffer, 0, bytesRead, "UTF-8"); // // InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "UTF-8"); // BufferedReader bufferedReader = new BufferedReader(inputStreamReader); // StringBuilder stringBuilder = new StringBuilder(); // // String line = null; // while ((line = bufferedReader.readLine()) != null) // { // stringBuilder.append(line + "\n"); // } // // String json = stringBuilder.toString(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); String json = writer.toString().trim(); boolean okay = parseStatusDocumentJson(json); if (okay) { processStatusDocument(); } else { if (!m_wasCancelled) { m_statusDocumentProcessingListener.onStatusDocumentProcessingComplete(); } } } catch (Exception ex) { ex.printStackTrace(); if (!m_wasCancelled) { m_statusDocumentProcessingListener.onStatusDocumentProcessingComplete(); } } finally { try { inputStream.close(); } catch (IOException ex) { ex.printStackTrace(); // ignore } } } }); }
From source file:com.digipom.manteresting.android.service.cache.CacheService.java
@Override public void onLowMemory() { if (LoggerConfig.canLog(Log.VERBOSE)) { Log.v(TAG, "onLowMemory()"); }//from w w w. ja va 2 s . com if (bitmapMemoryCache != null) { bitmapMemoryCache.evictAll(); } if (imageMemoryCache != null) { imageMemoryCache.evictAll(); } }
From source file:org.andstatus.app.util.MyLog.java
/** * Shortcut for verbose messages of the application *///from www. j av a2s . com public static int v(Object objTag, String msg) { String tag = objTagToString(objTag); int i = 0; if (isLoggable(tag, Log.VERBOSE)) { logToFile(VERBOSE, tag, msg, null); i = Log.v(tag, msg); } return i; }
From source file:com.senechaux.rutino.utils.NetworkUtilities.java
public static String authenticateGetToken(String username, String password, Handler handler, final Context context) { final HttpResponse resp; String response = ""; final ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair(PARAM_USERNAME, username)); params.add(new BasicNameValuePair(PARAM_PASSWORD, password)); HttpEntity entity = null;//from w ww . jav a 2 s.c o m try { entity = new UrlEncodedFormEntity(params); } catch (final UnsupportedEncodingException e) { // this should never happen. throw new AssertionError(e); } final HttpPost post = new HttpPost(Constants.AUTH_URI); post.addHeader(entity.getContentType()); post.setEntity(entity); maybeCreateHttpClient(); try { resp = mHttpClient.execute(post); response = EntityUtils.toString(resp.getEntity()); response = response.replace("\"", ""); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Resp: " + resp.toString()); } if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Successful authentication, resp: " + resp.toString()); } sendResult(true, handler, context, response); return response; } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Error authenticating" + resp.getStatusLine()); } sendResult(false, handler, context, response); return response; } } catch (final IOException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "IOException when getting authtoken", e); } sendResult(false, handler, context, response); return response; } finally { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "getAuthtoken completing"); } } }
From source file:com.github.vseguip.sweet.rest.SugarRestAPI.java
public String getToken(String username, String passwd, Context context, Handler handler) { final HttpResponse resp; JSONObject jso_content = new JSONObject(); try {/*from w w w . ja v a2 s . co m*/ JSONObject jso_user = new JSONObject(); String sendpasswd = passwd; if (mEncryptPasswd) sendpasswd = encryptor(passwd); jso_user.put("user_name", username).put("password", sendpasswd); jso_content.put("user_auth", jso_user).put("application", "Sweet"); } catch (JSONException e) { e.printStackTrace(); } final HttpPost post = prepareJSONRequest(jso_content.toString(), LOGIN_METHOD); HttpClient httpClient = getConnection(); try { resp = httpClient.execute(post); if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Successful authentication"); } String message = getResponseString(resp); String authToken; JSONObject json = null; try { // TODO: Convert JSON to contacts json = (JSONObject) new JSONTokener(message).nextValue(); authToken = json.getString("id"); } catch (JSONException e) { Log.i(TAG, "Error during login" + message); if (json != null) { if (json.has("description")) { try { message = json.getString("description");// get // errot // message! } catch (JSONException ex) { e.printStackTrace(); Log.e(TAG, "JSON exception, should never have gotten here!"); } ; } } sendResult(false, handler, context, "Error during login " + message); return null; } sendResult(true, handler, context, authToken); return authToken; } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Error authenticating" + resp.getStatusLine()); } sendResult(false, handler, context, "Error authenticating" + resp.getStatusLine()); return null; } } catch (final IOException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "IOException when getting authtoken", e); } sendResult(false, handler, context, "Error trying to connect to " + mServer.toString()); return null; } catch (Exception e) { e.printStackTrace(); sendResult(false, handler, context, "Error trying to validate your credentials. Check you server name and net connectivity."); return null; } finally { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "getAuthtoken completing"); } } }
From source file:at.jclehner.rxdroid.DrugEditFragment.java
@Override public void onResume() { super.onResume(); Intent intent = getActivity().getIntent(); String action = intent.getAction(); Drug drug = null;// w ww . jav a 2s . c om mWrapper = new DrugWrapper(); mFocusOnCurrentSupply = false; if (Intent.ACTION_EDIT.equals(action)) { final int drugId = intent.getIntExtra(DrugEditActivity2.EXTRA_DRUG_ID, -1); if (drugId == -1) throw new IllegalStateException("ACTION_EDIT requires EXTRA_DRUG_ID"); drug = Drug.get(drugId); if (LOGV) Util.dumpObjectMembers(TAG, Log.VERBOSE, drug, "drug"); mWrapper.set(drug); mDrugHash = drug.hashCode(); mIsEditing = true; if (intent.getBooleanExtra(DrugEditActivity2.EXTRA_FOCUS_ON_CURRENT_SUPPLY, false)) mFocusOnCurrentSupply = true; setActivityTitle(drug.getName()); } else if (Intent.ACTION_INSERT.equals(action)) { mIsEditing = false; mWrapper.set(new Drug()); setActivityTitle(R.string._title_new_drug); } else throw new IllegalArgumentException("Unhandled action " + action); if (mWrapper.refillSize == 0) mWrapper.currentSupply = Fraction.ZERO; OTPM.mapToPreferenceHierarchy(getPreferenceScreen(), mWrapper); getPreferenceScreen().setOnPreferenceChangeListener(mListener); if (!mIsEditing) { final Preference p = findPreference("active"); if (p != null) p.setEnabled(false); } if (mWrapper.refillSize == 0) { final Preference p = findPreference("currentSupply"); if (p != null) p.setEnabled(false); } if (mFocusOnCurrentSupply) { Log.i(TAG, "Will focus on current supply preference"); performPreferenceClick("currentSupply"); } getActivity().supportInvalidateOptionsMenu(); }
From source file:org.andstatus.app.util.MyLog.java
public static int v(Object objTag, String msg, Throwable tr) { String tag = objTagToString(objTag); int i = 0;//from w w w . ja v a2 s .co m if (isLoggable(tag, Log.VERBOSE)) { logToFile(VERBOSE, tag, msg, tr); i = Log.v(tag, msg, tr); } return i; }