當前位置: 首頁>>代碼示例>>Java>>正文


Java FLog.isLoggable方法代碼示例

本文整理匯總了Java中com.facebook.common.logging.FLog.isLoggable方法的典型用法代碼示例。如果您正苦於以下問題:Java FLog.isLoggable方法的具體用法?Java FLog.isLoggable怎麽用?Java FLog.isLoggable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.common.logging.FLog的用法示例。


在下文中一共展示了FLog.isLoggable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepareFrames

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void prepareFrames(
    BitmapFramePreparer bitmapFramePreparer,
    BitmapFrameCache bitmapFrameCache,
    AnimationBackend animationBackend,
    int lastDrawnFrameNumber) {
  for (int i = 1; i <= mFramesToPrepare; i++) {
    int nextFrameNumber = (lastDrawnFrameNumber + i) % animationBackend.getFrameCount();
    if (FLog.isLoggable(FLog.VERBOSE)) {
      FLog.v(TAG, "Preparing frame %d, last drawn: %d", nextFrameNumber, lastDrawnFrameNumber);
    }
    if (!bitmapFramePreparer.prepareFrame(
        bitmapFrameCache,
        animationBackend,
        nextFrameNumber)) {
      // We cannot prepare more frames, so we return early
      return;
    }
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:FixedNumberBitmapFramePreparationStrategy.java

示例2: getBucket

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Gets the freelist for the specified bucket. Create the freelist if there isn't one
 * @param bucketedSize the bucket size
 * @return the freelist for the bucket
 */
@VisibleForTesting
synchronized Bucket<V> getBucket(int bucketedSize) {
  // get an existing bucket
  Bucket<V> bucket = mBuckets.get(bucketedSize);
  if (bucket != null || !mAllowNewBuckets) {
    return bucket;
  }

  // create a new bucket
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(TAG, "creating new bucket %s", bucketedSize);
  }
  Bucket<V> newBucket = newBucket(bucketedSize);
  mBuckets.put(bucketedSize, newBucket);
  return newBucket;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:BasePool.java

示例3: onRequestStart

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onRequestStart(
    ImageRequest request,
    Object callerContextObject,
    String requestId,
    boolean isPrefetch) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(
        TAG,
        "time %d: onRequestSubmit: {requestId: %s, callerContext: %s, isPrefetch: %b}",
        getTime(),
        requestId,
        callerContextObject,
        isPrefetch);
    mRequestStartTimeMap.put(requestId, getTime());
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:RequestLoggingListener.java

示例4: onProducerFinishWithSuccess

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onProducerFinishWithSuccess(
    String requestId,
    String producerName,
    @Nullable Map<String, String> extraMap) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Pair<String, String> mapKey = Pair.create(requestId, producerName);
    Long startTime = mProducerStartTimeMap.remove(mapKey);
    long currentTime = getTime();
    FLog.v(
        TAG,
        "time %d: onProducerFinishWithSuccess: " +
            "{requestId: %s, producer: %s, elapsedTime: %d ms, extraMap: %s}",
        currentTime,
        requestId,
        producerName,
        getElapsedTime(startTime, currentTime),
        extraMap);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:RequestLoggingListener.java

示例5: onProducerFinishWithFailure

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onProducerFinishWithFailure(
    String requestId,
    String producerName,
    Throwable throwable,
    @Nullable Map<String, String> extraMap) {
  if (FLog.isLoggable(FLog.WARN)) {
    Pair<String, String> mapKey = Pair.create(requestId, producerName);
    Long startTime = mProducerStartTimeMap.remove(mapKey);
    long currentTime = getTime();
    FLog.w(
        TAG,
        throwable,
        "time %d: onProducerFinishWithFailure: " +
            "{requestId: %s, stage: %s, elapsedTime: %d ms, extraMap: %s, throwable: %s}",
        currentTime,
        requestId,
        producerName,
        getElapsedTime(startTime, currentTime),
        extraMap,
        throwable.toString());
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:RequestLoggingListener.java

示例6: onProducerFinishWithCancellation

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onProducerFinishWithCancellation(
    String requestId,
    String producerName,
    @Nullable Map<String, String> extraMap) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Pair<String, String> mapKey = Pair.create(requestId, producerName);
    Long startTime = mProducerStartTimeMap.remove(mapKey);
    long currentTime = getTime();
    FLog.v(
        TAG,
        "time %d: onProducerFinishWithCancellation: " +
            "{requestId: %s, stage: %s, elapsedTime: %d ms, extraMap: %s}",
        currentTime,
        requestId,
        producerName,
        getElapsedTime(startTime, currentTime),
        extraMap);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:RequestLoggingListener.java

示例7: onProducerEvent

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onProducerEvent(
    String requestId, String producerName, String producerEventName) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Pair<String, String> mapKey = Pair.create(requestId, producerName);
    Long startTime = mProducerStartTimeMap.get(mapKey);
    long currentTime = getTime();
    FLog.v(
        TAG,
        "time %d: onProducerEvent: {requestId: %s, stage: %s, eventName: %s; elapsedTime: %d ms}",
        getTime(),
        requestId,
        producerName,
        producerEventName,
        getElapsedTime(startTime, currentTime));
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:RequestLoggingListener.java

示例8: onRequestSuccess

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onRequestSuccess(
    ImageRequest request,
    String requestId,
    boolean isPrefetch) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Long startTime = mRequestStartTimeMap.remove(requestId);
    long currentTime = getTime();
    FLog.v(
        TAG,
        "time %d: onRequestSuccess: {requestId: %s, elapsedTime: %d ms}",
        currentTime,
        requestId,
        getElapsedTime(startTime, currentTime));
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:RequestLoggingListener.java

示例9: onAttach

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void onAttach() {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(
        TAG,
        "controller %x %s: onAttach: %s",
        System.identityHashCode(this),
        mId,
        mIsRequestSubmitted ? "request already submitted" : "request needs submit");
  }
  mEventTracker.recordEvent(Event.ON_ATTACH_CONTROLLER);
  Preconditions.checkNotNull(mSettableDraweeHierarchy);
  mDeferredReleaser.cancelDeferredRelease(this);
  mIsAttached = true;
  if (!mIsRequestSubmitted) {
    submitRequest();
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:AbstractDraweeController.java

示例10: getDataSource

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
protected DataSource<CloseableReference<CloseableImage>> getDataSource() {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(TAG, "controller %x: getDataSource", System.identityHashCode(this));
  }
  return mDataSourceSupplier.get();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:PipelineDraweeController.java

示例11: onTouchEvent

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(MotionEvent event) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(TAG, "controller %x %s: onTouchEvent %s", System.identityHashCode(this), mId, event);
  }
  if (mGestureDetector == null) {
    return false;
  }
  if (mGestureDetector.isCapturingGesture() || shouldHandleGesture()) {
    mGestureDetector.onTouchEvent(event);
    return true;
  }
  return false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:AbstractDraweeController.java

示例12: logStats

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Simple 'debug' logging of stats.
 * WARNING: The caller is responsible for synchronization
 */
@SuppressLint("InvalidAccessToGuardedField")
private void logStats() {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(
        TAG,
        "Used = (%d, %d); Free = (%d, %d)",
        mUsed.mCount,
        mUsed.mNumBytes,
        mFree.mCount,
        mFree.mNumBytes);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:BasePool.java

示例13: onProducerStart

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onProducerStart(String requestId, String producerName) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Pair<String, String> mapKey = Pair.create(requestId, producerName);
    long startTime = getTime();
    mProducerStartTimeMap.put(mapKey, startTime);
    FLog.v(
        TAG,
        "time %d: onProducerStart: {requestId: %s, producer: %s}",
        startTime,
        requestId,
        producerName);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:RequestLoggingListener.java

示例14: logMessageAndImage

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void logMessageAndImage(String messageAndMethod, T image) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    FLog.v(
        TAG,
        "controller %x %s: %s: image: %s %x",
        System.identityHashCode(this),
        mId,
        messageAndMethod,
        getImageClass(image),
        getImageHash(image));
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:AbstractDraweeController.java

示例15: onRequestCancellation

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public synchronized void onRequestCancellation(String requestId) {
  if (FLog.isLoggable(FLog.VERBOSE)) {
    Long startTime = mRequestStartTimeMap.remove(requestId);
    long currentTime = getTime();
    FLog.v(
        TAG,
        "time %d: onRequestCancellation: {requestId: %s, elapsedTime: %d ms}",
        currentTime,
        requestId,
        getElapsedTime(startTime, currentTime));
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:14,代碼來源:RequestLoggingListener.java


注:本文中的com.facebook.common.logging.FLog.isLoggable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。