本文整理匯總了Java中com.facebook.common.logging.FLog.e方法的典型用法代碼示例。如果您正苦於以下問題:Java FLog.e方法的具體用法?Java FLog.e怎麽用?Java FLog.e使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.common.logging.FLog
的用法示例。
在下文中一共展示了FLog.e方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void run() {
try {
// If we have a cached frame already, we don't need to do anything.
if (mBitmapFrameCache.contains(mFrameNumber)) {
FLog.v(TAG, "Frame %d is cached already.", mFrameNumber);
return;
}
// Prepare the frame.
if (prepareFrameAndCache(mFrameNumber, BitmapAnimationBackend.FRAME_TYPE_REUSED)) {
FLog.v(TAG, "Prepared frame frame %d.", mFrameNumber);
} else {
FLog.e(TAG, "Could not prepare frame %d.", mFrameNumber);
}
} finally {
synchronized (mPendingFrameDecodeJobs) {
mPendingFrameDecodeJobs.remove(mHashCode);
}
}
}
示例2: doInBackground
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
protected Void doInBackground(String... clipBoardString) {
try {
String sendClipBoardUrl =
Uri.parse(mDevSupportManager.getSourceUrl()).buildUpon()
.path("/copy-to-clipboard")
.query(null)
.build()
.toString();
for (String string: clipBoardString) {
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(null, string);
Request request = new Request.Builder().url(sendClipBoardUrl).post(body).build();
client.newCall(request).execute();
}
} catch (Exception e) {
FLog.e(ReactConstants.TAG, "Could not copy to the host clipboard", e);
}
return null;
}
示例3: handleException
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void handleException(Exception e) {
if (mIsDevSupportEnabled) {
if (e instanceof JSException) {
FLog.e(ReactConstants.TAG, "Exception in native call from JS", e);
// TODO #11638796: convert the stack into something useful
showNewError(
e.getMessage() + "\n\n" + ((JSException) e).getStack(),
new StackFrame[] {},
JSEXCEPTION_ERROR_COOKIE,
ErrorType.JS);
} else {
showNewJavaError(e.getMessage(), e);
}
} else {
mDefaultNativeModuleCallExceptionHandler.handleException(e);
}
}
示例4: getImageUrls
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private static List<String> getImageUrls(ImageUrlsRequest request) {
List<String> urls = new ArrayList<String>();
try {
String rawJson = downloadContentAsString(request.getEndpointUrl());
if (rawJson == null) {
return urls;
}
JSONObject json = new JSONObject(rawJson);
JSONArray data = json.getJSONArray("data");
for (int i = 0; i < data.length(); i++) {
JSONObject item = data.getJSONObject(i);
if (!item.has("type")) {
continue;
}
ImageFormat imageFormat = ImageFormat.getImageFormatForMime(item.getString("type"));
ImageSize imageSize = request.getImageSize(imageFormat);
if (imageSize != null) {
urls.add(getThumbnailLink(item, imageSize));
}
}
} catch (Exception e) {
FLog.e(TAG, "Exception fetching album", e);
}
return urls;
}
示例5: close
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@ReactMethod
public void close(int code, String reason, int id) {
WebSocket client = mWebSocketConnections.get(id);
if (client == null) {
// WebSocket is already closed
// Don't do anything, mirror the behaviour on web
return;
}
try {
client.close(code, reason);
mWebSocketConnections.remove(id);
} catch (Exception e) {
FLog.e(
ReactConstants.TAG,
"Could not close WebSocket connection for id " + id,
e);
}
}
示例6: doInBackground
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
protected Void doInBackground(String... jsonData) {
try {
String jscProfileUrl =
Uri.parse(mSourceUrl).buildUpon()
.path("/jsc-profile")
.query(null)
.build()
.toString();
OkHttpClient client = new OkHttpClient();
for (String json: jsonData) {
RequestBody body = RequestBody.create(JSON, json);
Request request =
new Request.Builder().url(jscProfileUrl).post(body).build();
client.newCall(request).execute();
}
} catch (IOException e) {
FLog.e(ReactConstants.TAG, "Failed not talk to server", e);
}
return null;
}
示例7: getPages
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
public static List<Page> getPages() {
try {
return Arrays.asList(instance().getPagesNative());
} catch (UnsatisfiedLinkError e) {
FLog.e(ReactConstants.TAG, "Inspector doesn't work in open source yet", e);
return Collections.emptyList();
}
}
示例8: awaitIndex
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* Blocks current thread until having finished initialization in Memory Index. Call only when you
* need memory index in cold start.
*/
@VisibleForTesting
protected void awaitIndex() {
try {
mCountDownLatch.await();
} catch (InterruptedException e) {
FLog.e(TAG, "Memory Index is not ready yet. ");
}
}
示例9: respond
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
public void respond(Object result) {
try {
JSONObject message = new JSONObject();
message.put("version", PROTOCOL_VERSION);
message.put("id", mId);
message.put("result", result);
mWebSocket.sendMessage(RequestBody.create(WebSocket.TEXT, message.toString()));
} catch (Exception e) {
FLog.e(TAG, "Responding failed", e);
}
}
示例10: hasBundleInAssets
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
* @return {@code true} if JS bundle {@param bundleAssetName} exists, in that case
* {@link ReactInstanceManager} should use that file from assets instead of downloading bundle
* from dev server
*/
public boolean hasBundleInAssets(String bundleAssetName) {
try {
String[] assets = mApplicationContext.getAssets().list("");
for (int i = 0; i < assets.length; i++) {
if (assets[i].equals(bundleAssetName)) {
return true;
}
}
} catch (IOException e) {
// Ignore this error and just fallback to downloading JS from devserver
FLog.e(ReactConstants.TAG, "Error while loading assets list");
}
return false;
}
示例11: abort
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void abort(String message, Throwable cause) {
FLog.e(TAG, "Error occurred, shutting down websocket connection: " + message, cause);
closeQuietly();
// Trigger failure callbacks
if (mConnectCallback != null) {
mConnectCallback.onFailure(cause);
mConnectCallback = null;
}
for (JSDebuggerCallback callback : mCallbacks.values()) {
callback.onFailure(cause);
}
mCallbacks.clear();
}
示例12: onHostPause
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void onHostPause() {
if (mReactChoreographer == null) {
FLog.e(NAME, "Called NativeAnimated.onHostPause() with a null ReactChoreographer.");
return;
}
clearFrameCallback();
}
示例13: getRotationAngle
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private static int getRotationAngle(String pathname) {
if (pathname != null) {
try {
ExifInterface exif = new ExifInterface(pathname);
return JfifUtil.getAutoRotateAngleFromOrientation(exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL));
} catch (IOException ioe) {
FLog.e(TAG, ioe, "Unable to retrieve thumbnail rotation for %s", pathname);
}
}
return 0;
}
示例14: abortOnMessage
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void abortOnMessage(Object id, String reason) {
if (id != null) {
(new ResponderImpl(id)).error(reason);
}
FLog.e(TAG, "Handling the message failed with reason: " + reason);
}
示例15: abort
import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void abort(String message, Throwable cause) {
FLog.e(TAG, "Error occurred, shutting down websocket connection: " + message, cause);
closeWebSocketQuietly();
}