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


Java FLog.w方法代碼示例

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


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

示例1: getDebugServerHost

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
public String getDebugServerHost() {
  // Check host setting first. If empty try to detect emulator type and use default
  // hostname for those
  String hostFromSettings = mPreferences.getString(PREFS_DEBUG_SERVER_HOST_KEY, null);

  if (!TextUtils.isEmpty(hostFromSettings)) {
    return Assertions.assertNotNull(hostFromSettings);
  }

  String host = AndroidInfoHelpers.getServerHost();

  if (host.equals(AndroidInfoHelpers.DEVICE_LOCALHOST)) {
    FLog.w(
      TAG,
      "You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' " +
        "to forward the debug server's port to the device.");
  }

  return host;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:21,代碼來源:PackagerConnectionSettings.java

示例2: finalize

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
protected void finalize() throws Throwable {
  try {
    // We put synchronized here so that lint doesn't warn about accessing mIsClosed, which is
    // guarded by this. Lint isn't aware of finalize semantics.
    synchronized (this) {
      if (mIsClosed) {
        return;
      }
    }

    FLog.w(
        TAG,
        "Finalized without closing: %x %x (type = %s)",
        System.identityHashCode(this),
        System.identityHashCode(mSharedReference),
        mSharedReference.get().getClass().getSimpleName());

    close();
  } finally {
    super.finalize();
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:CloseableReference.java

示例3: invoke

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable {
  ExecutorToken executorToken = mExecutorToken.get();
  if (executorToken == null) {
    FLog.w(ReactConstants.TAG, "Dropping JS call, ExecutorToken went away...");
    return null;
  }
  NativeArray jsArgs = args != null ? Arguments.fromJavaArgs(args) : new WritableNativeArray();
  mCatalystInstance.callFunction(
    executorToken,
    mModuleRegistration.getName(),
    method.getName(),
    jsArgs
  );
  return null;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:17,代碼來源:JavaScriptModuleRegistry.java

示例4: parse

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Parse a DebugServerException from the server json string.
 * @param str json string returned by the debug server
 * @return A DebugServerException or null if the string is not of proper form.
 */
@Nullable public static DebugServerException parse(String str) {
  if (TextUtils.isEmpty(str)) {
    return null;
  }
  try {
    JSONObject jsonObject = new JSONObject(str);
    String fullFileName = jsonObject.getString("filename");
    return new DebugServerException(
        jsonObject.getString("description"),
        shortenFileName(fullFileName),
        jsonObject.getInt("lineNumber"),
        jsonObject.getInt("column"));
  } catch (JSONException e) {
    // I'm not sure how strict this format is for returned errors, or what other errors there can
    // be, so this may end up being spammy. Can remove it later if necessary.
    FLog.w(ReactConstants.TAG, "Could not parse DebugServerException from: " + str, e);
    return null;
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:25,代碼來源:DebugServerException.java

示例5: containsKey

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Determine if an valid entry for the key exists in the staging area.
 */
public synchronized boolean containsKey(CacheKey key) {
  Preconditions.checkNotNull(key);
  if (!mMap.containsKey(key)) {
    return false;
  }
  EncodedImage storedEncodedImage = mMap.get(key);
  synchronized (storedEncodedImage) {
    if (!EncodedImage.isValid(storedEncodedImage)) {
      // Reference is not valid, this means that someone cleared reference while it was still in
      // use. Log error
      // TODO: 3697790
      mMap.remove(key);
      FLog.w(
          TAG,
          "Found closed reference %d for key %s (%d)",
          System.identityHashCode(storedEncodedImage),
          key.getUriString(),
          System.identityHashCode(key));
      return false;
    }
    return true;
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:StagingArea.java

示例6: containsAsync

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private Task<Boolean> containsAsync(final CacheKey key) {
  try {
    return Task.call(
        new Callable<Boolean>() {
          @Override
          public Boolean call() throws Exception {
            return checkInStagingAreaAndFileCache(key);
          }
        },
        mReadExecutor);
  } catch (Exception exception) {
    // Log failure
    // TODO: 3697790
    FLog.w(
        TAG,
        exception,
        "Failed to schedule disk-cache read for %s",
        key.getUriString());
    return Task.forError(exception);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:BufferedDiskCache.java

示例7: dispatchCancelEvent

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {
  // This means the gesture has already ended, via some other CANCEL or UP event. This is not
  // expected to happen very often as it would mean some child View has decided to intercept the
  // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
  if (mTargetTag == -1) {
    FLog.w(
      ReactConstants.TAG,
      "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
        "an UP/CANCEL event?");
    return;
  }

  Assertions.assertCondition(
    !mChildIsHandlingNativeGesture,
    "Expected to not have already sent a cancel for this gesture");
  Assertions.assertNotNull(eventDispatcher).dispatchEvent(
    TouchEvent.obtain(
      mTargetTag,
      TouchEventType.CANCEL,
      androidEvent,
      mGestureStartTime,
      mTargetCoordinates[0],
      mTargetCoordinates[1],
      mTouchEventCoalescingKeyHelper));
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:26,代碼來源:JSTouchDispatcher.java

示例8: clearAll

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Clears the disk cache and the staging area.
 */
public Task<Void> clearAll() {
  mStagingArea.clearAll();
  try {
    return Task.call(
        new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            mStagingArea.clearAll();
            mFileCache.clearAll();
            return null;
          }
        },
        mWriteExecutor);
  } catch (Exception exception) {
    // Log failure
    // TODO: 3697790
    FLog.w(TAG, exception, "Failed to schedule disk-cache clear");
    return Task.forError(exception);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:BufferedDiskCache.java

示例9: writeToDiskCache

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
/**
 * Writes to disk cache
 * @throws IOException
 */
private void writeToDiskCache(
    final CacheKey key,
    final EncodedImage encodedImage) {
  FLog.v(TAG, "About to write to disk-cache for key %s", key.getUriString());
  try {
    mFileCache.insert(
        key, new WriterCallback() {
          @Override
          public void write(OutputStream os) throws IOException {
            mPooledByteStreams.copy(encodedImage.getInputStream(), os);
          }
        }
    );
    FLog.v(TAG, "Successful disk-cache write for key %s", key.getUriString());
  } catch (IOException ioe) {
    // Log failure
    // TODO: 3697790
    FLog.w(TAG, ioe, "Failed to write to disk-cache for key %s", key.getUriString());
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:25,代碼來源:BufferedDiskCache.java

示例10: reconnect

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
private void reconnect() {
  if (mClosed) {
    throw new IllegalStateException("Can't reconnect closed client");
  }
  if (!mSuppressConnectionErrors) {
    FLog.w(TAG, "Couldn't connect to packager, will silently retry");
    mSuppressConnectionErrors = true;
  }
  mHandler.postDelayed(
      new Runnable() {
        @Override
        public void run() {
          // check that we haven't been closed in the meantime
          if (!mClosed) {
            connect();
          }
        }
      },
      RECONNECT_DELAY_MS);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:21,代碼來源:InspectorPackagerConnection.java

示例11: resolveRootTagFromReactTag

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
public int resolveRootTagFromReactTag(int reactTag) {
  if (mShadowNodeRegistry.isRootNode(reactTag)) {
    return reactTag;
  }

  ReactShadowNode node = resolveShadowNode(reactTag);
  int rootTag = 0;
  if (node != null) {
    rootTag = node.getRootNode().getReactTag();
  } else {
    FLog.w(
      ReactConstants.TAG,
      "Warning : attempted to resolve a non-existent react shadow node. reactTag=" + reactTag);
  }

  return rootTag;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:18,代碼來源:UIImplementation.java

示例12: notifyTaskFinished

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@ReactMethod
public void notifyTaskFinished(int taskId) {
  HeadlessJsTaskContext headlessJsTaskContext =
    HeadlessJsTaskContext.getInstance(getReactApplicationContext());
  if (headlessJsTaskContext.isTaskRunning(taskId)) {
    headlessJsTaskContext.finishTask(taskId);
  } else {
    FLog.w(
      HeadlessJsTaskSupportModule.class,
      "Tried to finish non-active task with id %d. Did it time out?",
      taskId);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:14,代碼來源:HeadlessJsTaskSupportModule.java

示例13: onCancelled

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
protected void onCancelled(Result<ReactApplicationContext> reactApplicationContextResult) {
  try {
    mMemoryPressureRouter.destroy(reactApplicationContextResult.get());
  } catch (Exception e) {
    FLog.w(ReactConstants.TAG, "Caught exception after cancelling react context init", e);
  } finally {
    mReactContextInitAsyncTask = null;
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:11,代碼來源:ReactInstanceManager.java

示例14: onChildStartedNativeGesture

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void onChildStartedNativeGesture(MotionEvent androidEvent) {
  if (mReactInstanceManager == null || !mIsAttachedToInstance ||
    mReactInstanceManager.getCurrentReactContext() == null) {
    FLog.w(
      ReactConstants.TAG,
      "Unable to dispatch touch to JS as the catalyst instance has not been attached");
    return;
  }
  ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();
  EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class)
    .getEventDispatcher();
  mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:15,代碼來源:ReactRootView.java

示例15: invokeCallback

import com.facebook.common.logging.FLog; //導入方法依賴的package包/類
@Override
public void invokeCallback(ExecutorToken executorToken, final int callbackID, final NativeArray arguments) {
  if (mDestroyed) {
    FLog.w(ReactConstants.TAG, "Invoking JS callback after bridge has been destroyed.");
    return;
  }

  jniCallJSCallback(executorToken, callbackID, arguments);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:10,代碼來源:CatalystInstanceImpl.java


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