本文整理匯總了Java中com.facebook.common.logging.FLog.wtf方法的典型用法代碼示例。如果您正苦於以下問題:Java FLog.wtf方法的具體用法?Java FLog.wtf怎麽用?Java FLog.wtf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.common.logging.FLog
的用法示例。
在下文中一共展示了FLog.wtf方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeLiveReference
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* Decreases the reference count of live object from the static map. Removes it if it's reference
* count has become 0.
*
* @param value the value to remove.
*/
private static void removeLiveReference(Object value) {
synchronized (sLiveObjects) {
Integer count = sLiveObjects.get(value);
if (count == null) {
// Uh oh.
FLog.wtf(
"SharedReference",
"No entry in sLiveObjects for value of type %s",
value.getClass());
} else if (count == 1) {
sLiveObjects.remove(value);
} else {
sLiveObjects.put(value, count - 1);
}
}
}
示例2: getTrimRatio
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public double getTrimRatio(MemoryTrimType trimType) {
switch (trimType) {
case OnCloseToDalvikHeapLimit:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return MemoryTrimType.OnCloseToDalvikHeapLimit.getSuggestedTrimRatio();
} else {
// On pre-lollipop versions we keep bitmaps on the native heap, so no need to trim here
// as it wouldn't help Dalvik heap anyway.
return 0;
}
case OnAppBackgrounded:
case OnSystemLowMemoryWhileAppInForeground:
case OnSystemLowMemoryWhileAppInBackground:
return 1;
default:
FLog.wtf(TAG, "unknown trim type: %s", trimType);
return 0;
}
}
示例3: loadScript
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* This loader delegates to (and so behaves like) the currently preferred
* loader. If that loader fails in a recoverable way and we fall back from it,
* it is replaced by the next most preferred loader.
*/
@Override
public String loadScript(CatalystInstanceImpl instance) {
while (true) {
try {
return getDelegateLoader().loadScript(instance);
} catch (Exception e) {
if (!e.getMessage().startsWith(RECOVERABLE)) {
throw e;
}
mLoaders.pop();
mRecoveredErrors.add(e);
FLog.wtf(TAG, "Falling back from recoverable error", e);
}
}
}
示例4: decrement
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* 'Decrement' an item from the counter
* @param numBytes size of the item in bytes
*/
public void decrement(int numBytes) {
if (this.mNumBytes >= numBytes && this.mCount > 0) {
this.mCount--;
this.mNumBytes -= numBytes;
} else {
FLog.wtf(
TAG,
"Unexpected decrement of %d. Current numBytes = %d, count = %d",
numBytes,
this.mNumBytes,
this.mCount);
}
}
示例5: getTrimRatio
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public double getTrimRatio(MemoryTrimType trimType) {
switch (trimType) {
case OnCloseToDalvikHeapLimit:
// Resources cached on native heap do not consume Dalvik heap, so no trimming here.
return 0;
case OnAppBackgrounded:
case OnSystemLowMemoryWhileAppInForeground:
case OnSystemLowMemoryWhileAppInBackground:
return 1;
default:
FLog.wtf(TAG, "unknown trim type: %s", trimType);
return 0;
}
}
示例6: onUnhandledException
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* Called whenever onNewResultImpl or onFailureImpl throw an exception
*/
protected void onUnhandledException(Exception e) {
FLog.wtf(this.getClass(), "unhandled exception", e);
}