Example usage for android.util Log VERBOSE

List of usage examples for android.util Log VERBOSE

Introduction

In this page you can find the example usage for android.util Log VERBOSE.

Prototype

int VERBOSE

To view the source code for android.util Log VERBOSE.

Click Source Link

Document

Priority constant for the println method; use Log.v.

Usage

From source file:com.digipom.manteresting.android.service.cache.BitmapMemoryCache.java

@Override
protected void entryRemoved(boolean evicted, String key, BitmapWithCategory oldValue,
        BitmapWithCategory newValue) {/*w w  w .j  ava  2 s  .  c o m*/
    if (LoggerConfig.canLog(Log.VERBOSE)) {
        Log.v(TAG, "Removing entry: " + key);
    }

    super.entryRemoved(evicted, key, oldValue, newValue);
    oldValue.bitmap.recycle();
}

From source file:com.digipom.manteresting.android.service.cache.ImageDownloader.java

byte[] download(String uri) {
    final HttpClient httpClient = new DefaultHttpClient();

    HttpGet httpGet = new HttpGet(uri);
    byte[] data = null;

    try {//from w  ww . jav a 2  s  .c o  m
        HttpResponse response = httpClient.execute(httpGet);

        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
            for (String extension : otherExtensionsToTry) {
                final String rewrittenUri = FileUtils.getFileNameWithoutExtension(uri) + '.' + extension;

                if (LoggerConfig.canLog(Log.VERBOSE)) {
                    Log.v(TAG, "Original URI " + uri + " not found. Trying with another extension: "
                            + rewrittenUri);
                }

                // Consume the content so the connection can be re-used.
                response.getEntity().consumeContent();

                httpGet = new HttpGet(rewrittenUri);
                response = httpClient.execute(httpGet);

                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    break;
                }
            }
        }

        InputStream is = null;

        try {
            final HttpEntity responseEntity = response.getEntity();
            is = responseEntity.getContent();
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final byte[] buffer = new byte[4096];

            int read;
            while ((read = is.read(buffer)) > 0) {
                baos.write(buffer, 0, read);
            }

            data = baos.toByteArray();
        } finally {
            if (is != null) {
                is.close();
                is = null;
            }
        }
    } catch (Throwable t) {
        if (LoggerConfig.canLog(Log.DEBUG)) {
            Log.d(TAG, "Download failed: " + uri, t);
        }
    }

    return data;
}

From source file:com.android.mms.widget.MmsWidgetProvider.java

@Override
public void onReceive(Context context, Intent intent) {
    if (Log.isLoggable(LogTag.WIDGET, Log.VERBOSE)) {
        Log.v(TAG, "onReceive intent: " + intent);
    }/*from w  w  w  .  j a v a  2  s. co m*/
    String action = intent.getAction();

    // The base class AppWidgetProvider's onReceive handles the normal widget intents. Here
    // we're looking for an intent sent by the messaging app when it knows a message has
    // been sent or received (or a conversation has been read) and is telling the widget it
    // needs to update.
    if (ACTION_NOTIFY_DATASET_CHANGED.equals(action)) {
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        int[] appWidgetIds = appWidgetManager
                .getAppWidgetIds(new ComponentName(context, MmsWidgetProvider.class));

        // We need to update all Mms appwidgets on the home screen.
        appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.conversation_list);
    } else {
        super.onReceive(context, intent);
    }
}

From source file:nick.dev.sina.app.SinaApp.java

@Override
public void onCreate() {
    super.onCreate();
    LoggerManager.setTagPrefix(getClass().getSimpleName());
    LoggerManager.setDebugLevel(Log.VERBOSE);
    ImageLoader.createShared(this);
}

From source file:com.example.android.common.logger.LogView.java

/**
 * Formats the log data and prints it out to the LogView.
 * @param priority Log level of the data being logged.  Verbose, Error, etc.
 * @param tag Tag for for the log data.  Can be used to organize log statements.
 * @param msg The actual message to be logged. The actual message to be logged.
 * @param tr If an exception was thrown, this can be sent along for the logging facilities
 *           to extract and print useful information.
 *///w w  w.  ja  va  2  s.co m
@Override
public void println(int priority, String tag, String msg, Throwable tr) {

    String priorityStr = null;

    // For the purposes of this View, we want to print the priority as readable text.
    switch (priority) {
    case android.util.Log.VERBOSE:
        priorityStr = "VERBOSE";
        break;
    case android.util.Log.DEBUG:
        priorityStr = "DEBUG";
        break;
    case android.util.Log.INFO:
        priorityStr = "INFO";
        break;
    case android.util.Log.WARN:
        priorityStr = "WARN";
        break;
    case android.util.Log.ERROR:
        priorityStr = "ERROR";
        break;
    case android.util.Log.ASSERT:
        priorityStr = "ASSERT";
        break;
    default:
        break;
    }

    // Handily, the Log class has a facility for converting a stack trace into a usable string.
    String exceptionStr = null;
    if (tr != null) {
        exceptionStr = android.util.Log.getStackTraceString(tr);
    }

    // Take the priority, tag, message, and exception, and concatenate as necessary
    // into one usable line of text.
    final StringBuilder outputBuilder = new StringBuilder();

    String delimiter = "\t";
    appendIfNotNull(outputBuilder, priorityStr, delimiter);
    appendIfNotNull(outputBuilder, tag, delimiter);
    appendIfNotNull(outputBuilder, msg, delimiter);
    appendIfNotNull(outputBuilder, exceptionStr, delimiter);

    // In case this was originally called from an AsyncTask or some other off-UI thread,
    // make sure the update occurs within the UI thread.
    ((Activity) getContext()).runOnUiThread((new Thread(new Runnable() {
        @Override
        public void run() {
            // Display the text we just generated within the LogView.
            appendToLog(outputBuilder.toString());
        }
    })));

    if (mNext != null) {
        mNext.println(priority, tag, msg, tr);
    }
}

From source file:com.facebook.stetho.server.SecureHttpRequestHandler.java

private static void enforcePermission(Context context, LocalSocket peer)
        throws IOException, PeerAuthorizationException {
    Credentials credentials = peer.getPeerCredentials();

    int uid = credentials.getUid();
    int pid = credentials.getPid();

    if (LogUtil.isLoggable(Log.VERBOSE)) {
        LogUtil.v("Got request from uid=%d, pid=%d", uid, pid);
    }//ww  w .  j a v a2s.c  o  m

    String requiredPermission = Manifest.permission.DUMP;
    int checkResult = context.checkPermission(requiredPermission, pid, uid);
    if (checkResult != PackageManager.PERMISSION_GRANTED) {
        throw new PeerAuthorizationException(
                "Peer pid=" + pid + ", uid=" + uid + " does not have " + requiredPermission);
    }
}

From source file:com.google.android.marvin.mytalkback.formatter.ProgressBarFormatter.java

@Override
public boolean format(AccessibilityEvent event, TalkBackService context, Utterance utterance) {
    if (shouldDropEvent(event)) {
        LogUtils.log(this, Log.VERBOSE, "Dropping unwanted progress bar event");
        return false;
    }//from   www . j av  a 2  s  .c  om

    final CharSequence text = AccessibilityEventUtils.getEventTextOrDescription(event);
    if (!TextUtils.isEmpty(text)) {
        utterance.addSpoken(text);
        return true;
    }

    final float percent = getProgressPercent(event);
    final float rate = (float) Math.pow(2.0, (percent / 50.0) - 1);

    utterance.addAuditory(R.id.sounds_scrolled_tone);
    utterance.getMetadata().putFloat(Utterance.KEY_METADATA_EARCON_RATE, rate);
    utterance.getMetadata().putFloat(Utterance.KEY_METADATA_EARCON_VOLUME, 0.5f);

    return true;
}

From source file:com.android.mms.widget.MmsWidgetProvider.java

/**
 * Update the widget appWidgetId//from  w  w w .j  a  v  a 2s. c  om
 */
private static void updateWidget(Context context, int appWidgetId) {
    if (Log.isLoggable(LogTag.WIDGET, Log.VERBOSE)) {
        Log.v(TAG, "updateWidget appWidgetId: " + appWidgetId);
    }
    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
    PendingIntent clickIntent;

    // Launch an intent to avoid ANRs
    final Intent intent = new Intent(context, MmsWidgetService.class);
    intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
    intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
    remoteViews.setRemoteAdapter(appWidgetId, R.id.conversation_list, intent);

    remoteViews.setTextViewText(R.id.widget_label, context.getString(R.string.sms_app_label));

    // Open Mms's app conversation list when click on header
    final Intent convIntent = new Intent(context, ConversationList.class);
    clickIntent = PendingIntent.getActivity(context, 0, convIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    remoteViews.setOnClickPendingIntent(R.id.widget_header, clickIntent);

    // On click intent for Compose
    final Intent composeIntent = new Intent(context, ComposeMessageActivity.class);
    composeIntent.setAction(Intent.ACTION_SENDTO);
    clickIntent = PendingIntent.getActivity(context, 0, composeIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    remoteViews.setOnClickPendingIntent(R.id.widget_compose, clickIntent);

    // On click intent for Conversation
    TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);
    taskStackBuilder.addParentStack(ComposeMessageActivity.class);
    Intent msgIntent = new Intent(Intent.ACTION_VIEW);
    msgIntent.setType("vnd.android-dir/mms-sms");
    taskStackBuilder.addNextIntent(msgIntent);
    remoteViews.setPendingIntentTemplate(R.id.conversation_list,
            taskStackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT));

    AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, remoteViews);
}

From source file:com.playhaven.android.diagnostic.test.FullScreenTest.java

@Override
protected void setUp() {
    try {/*  w  w w  . j a  v  a  2  s  .  c  o m*/
        clearAndConfigurePlayHaven();
        PlayHaven.setLogLevel(Log.VERBOSE);
    } catch (PlayHavenException e) {
        fail("Could not configure.");
    }
}

From source file:com.kth.common.utils.etc.LogUtil.java

/**
 * VERBOSE  ?.//from w w w  .j a  v a 2  s  . co m
 * 
 * @param clazz  ??  Class.
 * @param msg .
 */
public static void v(final Class<?> clazz, final String msg) {
    if (LogUtil.isVerboseEnabled()) {
        Log.println(Log.VERBOSE, TAG, LogUtil.getClassLineNumber(clazz) + " - " + msg);

        //  ?? ?   ?.
        if (LogUtil.isFileLogEnabled()) {
            write(Log.VERBOSE, LogUtil.getClassLineNumber(clazz), msg);
        }
    }
}