add a bunch of debug log statements

Reviewed By: achen1

Differential Revision: D5216191

fbshipit-source-id: 8e8e05d4bcd8b2112fbd15b3809946f1caa0edbe
This commit is contained in:
Aaron Chiu
2017-06-09 15:36:31 -07:00
committed by Facebook Github Bot
parent 4990c5c5b3
commit a1321aedd7
3 changed files with 25 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Process;
import android.util.Log;
import android.view.View;
import com.facebook.common.logging.FLog;
@@ -108,8 +109,6 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JSC_CALLS;
@ThreadSafe
public class ReactInstanceManager {
private static final String TAG = ReactInstanceManager.class.getSimpleName();
/**
* Listener interface for react instance events.
*/
@@ -225,7 +224,7 @@ public class ReactInstanceManager {
boolean setupReactContextInBackgroundEnabled,
boolean useSeparateUIBackgroundThread,
int minNumShakes) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()");
initializeSoLoaderIfNecessary(applicationContext);
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);
@@ -289,6 +288,7 @@ public class ReactInstanceManager {
* Called from UI thread.
*/
public void createReactContextInBackground() {
Log.d(ReactConstants.TAG, "ReactInstanceManager.createReactContextInBackground()");
Assertions.assertCondition(
!mHasStartedCreatingInitialContext,
"createReactContextInBackground should only be called when creating the react " +
@@ -317,6 +317,7 @@ public class ReactInstanceManager {
@ThreadConfined(UI)
private void recreateReactContextInBackgroundInner() {
Log.d(ReactConstants.TAG, "ReactInstanceManager.recreateReactContextInBackgroundInner()");
UiThreadUtil.assertOnUiThread();
if (mUseDeveloperSupport && mJSMainModuleName != null &&
@@ -360,6 +361,9 @@ public class ReactInstanceManager {
@ThreadConfined(UI)
private void recreateReactContextInBackgroundFromBundleLoader() {
Log.d(
ReactConstants.TAG,
"ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()");
recreateReactContextInBackground(
new JSCJavaScriptExecutor.Factory(mJSCConfig.getConfigMap()),
mBundleLoader);
@@ -695,6 +699,7 @@ public class ReactInstanceManager {
@ThreadConfined(UI)
private void onReloadWithJSDebugger(JavaJSExecutor.Factory jsExecutorFactory) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.onReloadWithJSDebugger()");
recreateReactContextInBackground(
new ProxyJavaScriptExecutor.Factory(jsExecutorFactory),
JSBundleLoader.createRemoteDebuggerBundleLoader(
@@ -704,6 +709,7 @@ public class ReactInstanceManager {
@ThreadConfined(UI)
private void onJSBundleLoadedFromServer() {
Log.d(ReactConstants.TAG, "ReactInstanceManager.onJSBundleLoadedFromServer()");
recreateReactContextInBackground(
new JSCJavaScriptExecutor.Factory(mJSCConfig.getConfigMap()),
JSBundleLoader.createCachedBundleFromNetworkLoader(
@@ -715,6 +721,7 @@ public class ReactInstanceManager {
private void recreateReactContextInBackground(
JavaScriptExecutor.Factory jsExecutorFactory,
JSBundleLoader jsBundleLoader) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.recreateReactContextInBackground()");
UiThreadUtil.assertOnUiThread();
final ReactContextInitParams initParams = new ReactContextInitParams(
@@ -729,6 +736,7 @@ public class ReactInstanceManager {
@ThreadConfined(UI)
private void runCreateReactContextOnNewThread(final ReactContextInitParams initParams) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.runCreateReactContextOnNewThread()");
UiThreadUtil.assertOnUiThread();
if (mCurrentReactContext != null) {
tearDownReactContext(mCurrentReactContext);
@@ -791,6 +799,7 @@ public class ReactInstanceManager {
}
private void setupReactContext(ReactApplicationContext reactContext) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.setupReactContext()");
ReactMarker.logMarker(PRE_SETUP_REACT_CONTEXT_END);
ReactMarker.logMarker(SETUP_REACT_CONTEXT_START);
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "setupReactContext");
@@ -849,6 +858,7 @@ public class ReactInstanceManager {
private void attachRootViewToInstance(
final ReactRootView rootView,
CatalystInstance catalystInstance) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.attachRootViewToInstance()");
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachRootViewToInstance");
if (!mSetupReactContextInBackgroundEnabled) {
UiThreadUtil.assertOnUiThread();
@@ -878,12 +888,14 @@ public class ReactInstanceManager {
private void detachViewFromInstance(
ReactRootView rootView,
CatalystInstance catalystInstance) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.detachViewFromInstance()");
UiThreadUtil.assertOnUiThread();
catalystInstance.getJSModule(AppRegistry.class)
.unmountApplicationComponentAtRootTag(rootView.getId());
}
private void tearDownReactContext(ReactContext reactContext) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.tearDownReactContext()");
UiThreadUtil.assertOnUiThread();
if (mLifecycleState == LifecycleState.RESUMED) {
reactContext.onHostPause();
@@ -907,7 +919,7 @@ public class ReactInstanceManager {
private ReactApplicationContext createReactContext(
JavaScriptExecutor jsExecutor,
JSBundleLoader jsBundleLoader) {
FLog.i(ReactConstants.TAG, "Creating react context.");
Log.d(ReactConstants.TAG, "ReactInstanceManager.createReactContext()");
ReactMarker.logMarker(CREATE_REACT_CONTEXT_START);
final ReactApplicationContext reactContext = new ReactApplicationContext(mApplicationContext);
NativeModuleRegistryBuilder nativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(