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.CacheService.java

@Override
public void onDestroy() {
    if (LoggerConfig.canLog(Log.VERBOSE)) {
        Log.v(TAG, "onDestroy()");
    }//from ww w.  ja  v  a 2  s .co  m

    synchronized (pendingRunnables) {
        for (Runnable runnable : pendingRunnables.values()) {
            loadExecutor.remove(runnable);
        }

        pendingRunnables.clear();
        loadExecutor.shutdown();
    }

    if (bitmapMemoryCache != null) {
        bitmapMemoryCache.evictAll();
        bitmapMemoryCache = null;
    }

    if (imageMemoryCache != null) {
        imageMemoryCache.evictAll();
        imageMemoryCache = null;
    }

    if (primaryFileCache != null) {
        primaryFileCache.flush();
        primaryFileCache.close();
        primaryFileCache = null;
    }

    if (secondaryFileCache != null) {
        secondaryFileCache.flush();
        secondaryFileCache.close();
        secondaryFileCache = null;
    }

    imageDownloader = null;
}

From source file:com.gosuncn.core.percentlayout.PercentLayoutHelper.java

/**
 * Constructs a PercentLayoutInfo from attributes associated with a View.
 * Call this method from {@code LayoutParams(Context c, AttributeSet attrs)}
 * constructor.//from   w ww . j  av a  2 s  .c o  m
 */
public static PercentLayoutInfo getPercentLayoutInfo(Context context, AttributeSet attrs) {
    PercentLayoutInfo info = null;
    TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.PercentLayout_Layout);

    // float value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_widthPercent,
    // 1, 1,
    // -1f);
    String sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_widthPercent);
    PercentLayoutInfo.PercentVal percentVal = getPercentVal(sizeStr, true);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent width: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.widthPercent = percentVal;
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_heightPercent,
    // 1, 1, -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_heightPercent);
    percentVal = getPercentVal(sizeStr, false);

    if (sizeStr != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent height: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.heightPercent = percentVal;
    }

    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginPercent,
    // 1, 1, -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginPercent);
    // just for judge
    percentVal = getPercentVal(sizeStr, false);

    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.leftMarginPercent = getPercentVal(sizeStr, true);
        info.topMarginPercent = getPercentVal(sizeStr, false);
        info.rightMarginPercent = getPercentVal(sizeStr, true);
        info.bottomMarginPercent = getPercentVal(sizeStr, false);
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginLeftPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginLeftPercent);
    percentVal = getPercentVal(sizeStr, true);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent left margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.leftMarginPercent = percentVal;
    }

    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginTopPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginTopPercent);
    percentVal = getPercentVal(sizeStr, false);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent top margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.topMarginPercent = percentVal;
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginRightPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginRightPercent);
    percentVal = getPercentVal(sizeStr, true);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent right margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.rightMarginPercent = percentVal;
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginBottomPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginBottomPercent);
    percentVal = getPercentVal(sizeStr, false);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent bottom margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.bottomMarginPercent = percentVal;
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginStartPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginStartPercent);
    percentVal = getPercentVal(sizeStr, true);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent start margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.startMarginPercent = percentVal;
    }
    // value =
    // array.getFraction(R.styleable.PercentLayout_Layout_layout_marginEndPercent,
    // 1, 1,
    // -1f);
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_marginEndPercent);
    percentVal = getPercentVal(sizeStr, true);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent end margin: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.endMarginPercent = percentVal;
    }

    // textSizePercent
    sizeStr = array.getString(R.styleable.PercentLayout_Layout_layout_textSizePercent);
    percentVal = getPercentVal(sizeStr, false);
    if (percentVal != null) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "percent text size: " + percentVal.percent);
        }
        info = info != null ? info : new PercentLayoutInfo();
        info.textSizePercent = percentVal;
    }
    array.recycle();
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "constructed: " + info);
    }
    return info;
}

From source file:com.dirkgassen.wator.ui.fragment.WatorDisplay.java

/**
 * Called when the {@link WorldHost} has updated its simulator. This method repaints the bitmap for the view.
 *
 * @param world {@link com.dirkgassen.wator.simulator.Simulator.WorldInspector} of the {@link Simulator} that was
 *              updated//www  . j  av  a 2s .  co  m
 */
@Override
public void worldUpdated(Simulator.WorldInspector world) {
    if (Log.isLoggable("Wa-Tor", Log.VERBOSE)) {
        Log.v("Wa-Tor", "Updating image");
    }
    long startUpdate = System.currentTimeMillis();

    int worldWidth = world.getWorldWidth();
    int worldHeight = world.getWorldHeight();
    int fishBreedTime = world.getFishBreedTime();
    int sharkStarveTime = world.getSharkStarveTime();

    if (planetBitmap == null || planetBitmap.getWidth() != worldWidth
            || planetBitmap.getHeight() != worldHeight) {
        if (Log.isLoggable("Wa-Tor", Log.DEBUG)) {
            Log.d("Wa-Tor", "(Re)creating bitmap/pixels");
        }
        planetBitmap = Bitmap.createBitmap(worldWidth, worldHeight, Bitmap.Config.ARGB_8888);
        pixels = new int[worldWidth * worldHeight];
    }
    if (fishAgeColors == null || fishAgeColors.length != fishBreedTime) {
        if (Log.isLoggable("Wa-Tor", Log.DEBUG)) {
            Log.d("Wa-Tor", "(Re)creating fish colors");
        }
        fishAgeColors = calculateIndividualAgeColors(fishBreedTime,
                ContextCompat.getColor(getContext(), R.color.fish_young),
                ContextCompat.getColor(getContext(), R.color.fish_old));
    }
    if (sharkAgeColors == null || sharkAgeColors.length != sharkStarveTime) {
        if (Log.isLoggable("Wa-Tor", Log.DEBUG)) {
            Log.d("Wa-Tor", "(Re)creating shark colors");
        }
        sharkAgeColors = calculateIndividualAgeColors(sharkStarveTime,
                ContextCompat.getColor(getContext(), R.color.shark_young),
                ContextCompat.getColor(getContext(), R.color.shark_old));
    }

    do {
        if (world.isEmpty()) {
            pixels[world.getCurrentPosition()] = waterColor;
        } else if (world.isFish()) {
            pixels[world.getCurrentPosition()] = fishAgeColors[world.getFishAge() - 1];
        } else {
            pixels[world.getCurrentPosition()] = sharkAgeColors[world.getSharkHunger() - 1];
        }
    } while (world.moveToNext() != Simulator.WorldInspector.RESET);
    if (Log.isLoggable("Wa-Tor", Log.VERBOSE)) {
        Log.v("Wa-Tor", "Generating pixels " + (System.currentTimeMillis() - startUpdate) + " ms");
    }
    synchronized (WatorDisplay.this) {
        if (planetBitmap != null) {
            int width = planetBitmap.getWidth();
            int height = planetBitmap.getHeight();
            planetBitmap.setPixels(pixels, 0, width, 0, 0, width, height);
        }
    }
    handler.post(updateImageRunner);
    if (Log.isLoggable("Wa-Tor", Log.VERBOSE)) {
        Log.v("Wa-Tor", "Repainting took " + (System.currentTimeMillis() - startUpdate) + " ms");
    }
}

From source file:com.android.screenspeak.eventprocessor.ProcessorAccessibilityHints.java

private void speakHint(String text) {
    // Never speak hint text if the tutorial is active
    if (AccessibilityTutorialActivity.isTutorialActive()) {
        LogUtils.log(this, Log.VERBOSE, "Dropping hint speech because tutorial is active.");
        return;/*from   w ww.  j  av a 2 s .com*/
    }

    // Use QUEUE mode so that we don't interrupt more important messages.
    mSpeechController.speak(text, SpeechController.QUEUE_MODE_QUEUE, FeedbackItem.FLAG_NO_HISTORY, null);
}

From source file:org.restcomm.android.olympus.SettingsActivity.java

@Override
public void onServiceConnected(ComponentName className, IBinder service) {
    Log.i(TAG, "%% onServiceConnected");
    // We've bound to LocalService, cast the IBinder and get LocalService instance
    RCDevice.RCDeviceBinder binder = (RCDevice.RCDeviceBinder) service;
    device = binder.getService();/*from   ww  w  .  j av  a 2  s. c o  m*/

    // Remember there's a chance that the user navigates to Settings and then hits home. In that case,
    // when they come back RCDevice won't be initialized
    if (!device.isInitialized()) {
        Log.i(TAG, "RCDevice not initialized; initializing");
        HashMap<String, Object> params = Utils.createParameters(prefs, this);

        // If exception is raised, we will close activity only if it comes from login
        // otherwise we will just show the error dialog
        device.setLogLevel(Log.VERBOSE);
        try {
            device.initialize(getApplicationContext(), params, this);
        } catch (RCException e) {
            showOkAlert("RCDevice Initialization Error", e.errorText);
        }
    }

    // We have the device reference
    if (device.getState() == RCDevice.DeviceState.OFFLINE) {
        getSupportActionBar()
                .setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorTextSecondary)));
    } else {
        getSupportActionBar()
                .setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorPrimary)));
    }

    serviceBound = true;
}

From source file:com.googlecode.eyesfree.brailleback.BrailleIME.java

@Override
public void onStartInput(EditorInfo attribute, boolean restarting) {
    super.onStartInput(attribute, restarting);
    LogUtils.log(this, Log.VERBOSE,
            "onStartInput: inputType: %x, imeOption: %x, " + ", label: %s, hint: %s, package: %s, ",
            attribute.inputType, attribute.imeOptions, attribute.label, attribute.hintText,
            attribute.packageName);//from ww  w  .  j a  va2  s . c o  m
    InputConnection ic = getCurrentInputConnection();
    if (ic != null) {
        ExtractedTextRequest req = new ExtractedTextRequest();
        req.token = ++mExtractedTextToken;
        req.hintMaxChars = MAX_REQUEST_CHARS;
        mExtractedText = getCurrentInputConnection().getExtractedText(req,
                InputConnection.GET_EXTRACTED_TEXT_MONITOR);
    } else {
        mExtractedText = null;
    }
    updateCurrentText();
    updateDisplay();

    Host host = getHost();
    if (host != null) {
        host.onStartInput(attribute, restarting);
    }
}

From source file:com.android.screenspeak.speechrules.NodeSpeechRuleProcessor.java

/**
 * Processes the specified node using a series of speech rules.
 *
 * @param node The node to process./*from   w ww .  j a v  a 2s  .c  om*/
 * @param event The source event, may be {@code null} when called with
 *            non-source nodes.
 * @return A string representing the given node, or {@code null} if the node
 *         could not be processed.
 */
public CharSequence getDescriptionForNode(AccessibilityNodeInfoCompat node, AccessibilityEvent event) {
    for (NodeSpeechRule rule : mRules) {
        if (rule.accept(node, event)) {
            LogUtils.log(this, Log.VERBOSE, "Processing node using %s", rule);
            return rule.format(mContext, node, event);
        }
    }

    return null;
}

From source file:au.com.dektech.dektalk.MainActivity.java

@Override
public void onServiceConnected(ComponentName className, IBinder service) {
    Log.i(TAG, "%% onServiceConnected");
    // We've bound to LocalService, cast the IBinder and get LocalService instance
    RCDevice.RCDeviceBinder binder = (RCDevice.RCDeviceBinder) service;
    device = binder.getService();/*from ww  w  . j  a v a 2 s. c om*/

    Intent intent = new Intent(getApplicationContext(), MainActivity.class);

    HashMap<String, Object> params = new HashMap<String, Object>();
    // we don't have a separate activity for the calls and messages, so let's use the same intent both for calls and messages
    params.put(RCDevice.ParameterKeys.INTENT_INCOMING_CALL, intent);
    params.put(RCDevice.ParameterKeys.INTENT_INCOMING_MESSAGE, intent);
    params.put(RCDevice.ParameterKeys.SIGNALING_DOMAIN, "dektalk.homenet.org");
    params.put(RCDevice.ParameterKeys.SIGNALING_USERNAME, "dektalk");
    params.put(RCDevice.ParameterKeys.SIGNALING_PASSWORD, "dektalk");
    params.put(RCDevice.ParameterKeys.MEDIA_ICE_URL, "https://service.xirsys.com/ice");
    params.put(RCDevice.ParameterKeys.MEDIA_ICE_USERNAME, "atsakiridis");
    params.put(RCDevice.ParameterKeys.MEDIA_ICE_PASSWORD, "4e89a09e-bf6f-11e5-a15c-69ffdcc2b8a7");
    params.put(RCDevice.ParameterKeys.MEDIA_TURN_ENABLED, false);
    //params.put(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, prefs.getBoolean(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, false));

    // The SDK provides the user with default sounds for calling, ringing, busy (declined) and message, but the user can override them
    // by providing their own resource files (i.e. .wav, .mp3, etc) at res/raw passing them with Resource IDs like R.raw.user_provided_calling_sound
    //params.put(RCDevice.ParameterKeys.RESOURCE_SOUND_CALLING, R.raw.user_provided_calling_sound);
    //params.put(RCDevice.ParameterKeys.RESOURCE_SOUND_RINGING, R.raw.user_provided_ringing_sound);
    //params.put(RCDevice.ParameterKeys.RESOURCE_SOUND_DECLINED, R.raw.user_provided_declined_sound);
    //params.put(RCDevice.ParameterKeys.RESOURCE_SOUND_MESSAGE, R.raw.user_provided_message_sound);

    // This is for debugging purposes, not for release builds
    //params.put(RCDevice.ParameterKeys.SIGNALING_JAIN_SIP_LOGGING_ENABLED, prefs.getBoolean(RCDevice.ParameterKeys.SIGNALING_JAIN_SIP_LOGGING_ENABLED, true));

    if (!device.isInitialized()) {
        device.initialize(getApplicationContext(), params, this);
        device.setLogLevel(Log.VERBOSE);
    }

    serviceBound = true;
}

From source file:com.android.talkback.formatter.TouchExplorationFormatter.java

/**
 * Formatter that returns an utterance to announce touch exploration.
 *//*w  w w  . ja  v a 2  s. c om*/
@Override
public boolean format(AccessibilityEvent event, TalkBackService context, Utterance utterance) {
    if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && EventState.getInstance()
            .checkAndClearRecentEvent(EventState.EVENT_SKIP_FOCUS_PROCESSING_AFTER_GRANULARITY_MOVE)) {
        return false;
    }
    if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && EventState.getInstance()
            .checkAndClearRecentEvent(EventState.EVENT_SKIP_FOCUS_PROCESSING_AFTER_CURSOR_CONTROL)) {
        return false;
    }

    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    final AccessibilityNodeInfoCompat sourceNode = record.getSource();
    final AccessibilityNodeInfoCompat focusedNode = getFocusedNode(event.getEventType(), sourceNode);

    // Drop the event if the source node was non-null, but the focus
    // algorithm decided to drop the event by returning null.
    if ((sourceNode != null) && (focusedNode == null)) {
        AccessibilityNodeInfoUtils.recycleNodes(sourceNode);
        return false;
    }

    LogUtils.log(this, Log.VERBOSE, "Announcing node: %s", focusedNode);

    // Transition the collection state if necessary.
    mCollectionState.updateCollectionInformation(focusedNode, event);

    // Populate the utterance.
    addEarconWhenAccessibilityFocusMovesToTheDivider(utterance, focusedNode);
    addSpeechFeedback(utterance, focusedNode, event, sourceNode);
    addAuditoryHapticFeedback(utterance, focusedNode);

    // By default, touch exploration flushes all other events.
    utterance.getMetadata().putInt(Utterance.KEY_METADATA_QUEUING, DEFAULT_QUEUING_MODE);

    // Events formatted by this class should always advance continuous
    // reading, if active.
    utterance.addSpokenFlag(FeedbackItem.FLAG_ADVANCE_CONTINUOUS_READING);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mLastFocusedWindowId = focusedNode.getWindowId();
    }

    AccessibilityNodeInfoUtils.recycleNodes(sourceNode, focusedNode);

    return true;
}

From source file:com.scvngr.levelup.core.util.LogManager.java

/**
 * Logs a message to the Android log.//from   w  w  w  .  j a  v  a  2 s.co m
 *
 * @param logLevel {@link Log#VERBOSE}, {@link Log#DEBUG}, {@link Log#INFO}, {@link Log#WARN},
 *        or {@link Log#ERROR}.
 * @param message the message to be logged. This message is expected to be a format string if
 *        messageFormatArgs is not null.
 * @param messageFormatArgs formatting arguments for the message, or null if the string is to be
 *        handled without formatting.
 * @param err an optional error to log with a stacktrace.
 */
private static void logMessage(final int logLevel, @NonNull final String message,
        @Nullable final Object[] messageFormatArgs, @Nullable final Throwable err) {
    final String preppedMessage = formatMessage(message, messageFormatArgs);

    final StackTraceElement[] trace = Thread.currentThread().getStackTrace();
    final String sourceClass = trace[STACKTRACE_SOURCE_FRAME_INDEX].getClassName();
    final String sourceMethod = trace[STACKTRACE_SOURCE_FRAME_INDEX].getMethodName();

    final String logcatLogLine = String.format(Locale.US, FORMAT, Thread.currentThread().getName(), sourceClass,
            sourceMethod, preppedMessage);

    switch (logLevel) {
    case Log.VERBOSE: {
        if (null == err) {
            Log.v(sLogTag, logcatLogLine);
        } else {
            Log.v(sLogTag, logcatLogLine, err);
        }
        break;
    }
    case Log.DEBUG: {
        if (null == err) {
            Log.d(sLogTag, logcatLogLine);
        } else {
            Log.d(sLogTag, logcatLogLine, err);
        }
        break;
    }
    case Log.INFO: {
        if (null == err) {
            Log.i(sLogTag, logcatLogLine);
        } else {
            Log.i(sLogTag, logcatLogLine, err);
        }
        break;
    }
    case Log.WARN: {
        if (null == err) {
            Log.w(sLogTag, logcatLogLine);
        } else {
            Log.w(sLogTag, logcatLogLine, err);
        }
        break;
    }
    case Log.ERROR: {
        if (null == err) {
            Log.e(sLogTag, logcatLogLine);
        } else {
            Log.e(sLogTag, logcatLogLine, err);
        }
        break;
    }
    case Log.ASSERT: {
        if (null == err) {
            Log.wtf(sLogTag, logcatLogLine);
        } else {
            Log.wtf(sLogTag, logcatLogLine, err);
        }
        break;
    }
    default: {
        throw new AssertionError();
    }
    }
}