Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 9350fbe

Browse files
committed
change logging tag
1 parent c4d0415 commit 9350fbe

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class CodePush {
5050
private final String PENDING_UPDATE_IS_LOADING_KEY = "isLoading";
5151
private final String ASSETS_BUNDLE_PREFIX = "assets://";
5252
private final String CODE_PUSH_PREFERENCES = "CodePush";
53-
private final String CODE_PUSH_TAG = "CodePush";
5453
private final String DOWNLOAD_PROGRESS_EVENT_NAME = "CodePushDownloadProgress";
5554
private final String RESOURCES_BUNDLE = "resources.arsc";
5655
private final String REACT_DEV_BUNDLE_CACHE_FILE_NAME = "ReactNativeDevBundle.js";
@@ -136,9 +135,9 @@ public String getBundleUrl(String assetsBundleFileName) {
136135
return packageFilePath;
137136
} else {
138137
// The binary version is newer.
139-
Log.d(CODE_PUSH_TAG, "Found a package installed via CodePush that was " +
140-
"installed under a different binary version, so the JS bundle packaged " +
141-
"in the binary will be used as the most current package.");
138+
CodePushUtils.log("Found a package installed via CodePush that was installed " +
139+
"under a different binary version, so the JS bundle packaged in the " +
140+
"binary will be used as the most current package.");
142141
return binaryJsBundleUrl;
143142
}
144143
} catch (IOException e) {
@@ -237,8 +236,8 @@ private JSONObject getPendingUpdate() {
237236
return pendingUpdate;
238237
} catch (JSONException e) {
239238
// Should not happen.
240-
Log.e(CODE_PUSH_TAG, "Unable to parse pending update metadata " +
241-
pendingUpdateString + " stored in SharedPreferences", e);
239+
CodePushUtils.log("Unable to parse pending update metadata " + pendingUpdateString +
240+
" stored in SharedPreferences");
242241
return null;
243242
}
244243
}
@@ -252,7 +251,7 @@ private void initializeUpdateAfterRestart() {
252251
if (updateIsLoading) {
253252
// Pending update was initialized, but notifyApplicationReady was not called.
254253
// Therefore, deduce that it is a broken update and rollback.
255-
Log.d(CODE_PUSH_TAG, "Update did not finish loading the last time, rolling back to a previous version.");
254+
CodePushUtils.log("Update did not finish loading the last time, rolling back to a previous version.");
256255
rollbackPackage();
257256
} else {
258257
// Clear the React dev bundle cache so that new updates can be loaded.

android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.microsoft.codepush.react;
22

3+
import android.util.Log;
4+
35
import com.facebook.react.bridge.Arguments;
46
import com.facebook.react.bridge.NoSuchKeyException;
57
import com.facebook.react.bridge.ReadableArray;
@@ -23,6 +25,8 @@
2325

2426
public class CodePushUtils {
2527

28+
public static final String REACT_NATIVE_LOG_TAG = "ReactNative";
29+
2630
public static String appendPathComponent(String basePath, String appendPathComponent) {
2731
return new File(basePath, appendPathComponent).getAbsolutePath();
2832
}
@@ -260,4 +264,8 @@ public static String tryGetString(ReadableMap map, String key) {
260264
return null;
261265
}
262266
}
267+
268+
public static void log(String message) {
269+
Log.d(REACT_NATIVE_LOG_TAG, "[CodePush] " + message);
270+
}
263271
}

0 commit comments

Comments
 (0)