Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32edf08

Browse filesBrowse files
committed
fix(log): change the log level to suitable level
1 parent 7415e49 commit 32edf08
Copy full SHA for 32edf08

File tree

6 files changed

+19
-23
lines changed
Filter options

6 files changed

+19
-23
lines changed

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/app/TinkerServerManager.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/app/TinkerServerManager.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class TinkerServerManager {
6666
public static void installTinkerServer(Context context, Tinker tinker,
6767
int hours, String appKey, String appVersion, String channel) {
6868
final boolean debug = Debugger.getInstance(context).isDebug();
69-
TinkerLog.w(TAG, String.format("installTinkerServer, debug value: %s appVersion: %s, channel: %s",
69+
TinkerLog.i(TAG, String.format("installTinkerServer, debug value: %s appVersion: %s, channel: %s",
7070
String.valueOf(debug), appVersion, channel)
7171
);
7272
sTinkerServerClient = TinkerServerClient.init(

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/client/DefaultPatchRequestCallback.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/client/DefaultPatchRequestCallback.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public boolean beforePatchRequest() {
8585

8686
@Override
8787
public boolean onPatchUpgrade(File file, Integer newVersion, Integer currentVersion) {
88-
TinkerLog.w(TAG, "onPatchUpgrade, file:%s, newVersion:%d, currentVersion:%d",
88+
TinkerLog.i(TAG, "onPatchUpgrade, file:%s, newVersion:%d, currentVersion:%d",
8989
file.getPath(), newVersion, currentVersion);
9090
TinkerServerClient client = TinkerServerClient.get();
9191
Context context = client.getContext();
@@ -172,7 +172,7 @@ public void rollbackPatchDirectly() {
172172

173173
@Override
174174
public void updatePatchConditions() {
175-
TinkerLog.w(TAG, "updatePatchConditions");
175+
TinkerLog.d(TAG, "updatePatchConditions");
176176
TinkerServerClient client = TinkerServerClient.get();
177177
// wifi condition should be updated
178178
client.updateTinkerCondition(TinkerServerClient.CONDITION_WIFI,
@@ -184,7 +184,7 @@ public boolean increaseDownloadError(Context context) {
184184
TinkerServerClient.SHARE_SERVER_PREFERENCE_CONFIG, Context.MODE_PRIVATE
185185
);
186186
int currentCount = sp.getInt(TINKER_DOWNLOAD_FAIL_TIMES, 0);
187-
TinkerLog.w(TAG, "increaseDownloadError, current count:%d", currentCount);
187+
TinkerLog.i(TAG, "increaseDownloadError, current count:%d", currentCount);
188188

189189
if (currentCount >= TINKER_DOWNLOAD_FAIL_MAX_TIMES) {
190190
sp.edit().putInt(TINKER_DOWNLOAD_FAIL_TIMES, 0).commit();

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/client/TinkerClientAPI.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/client/TinkerClientAPI.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ public void onDataReady(String data) {
137137
if (response == null) {
138138
callback.onPatchSyncFail(new RuntimeException("Can't sync with version: response == null"));
139139
} else {
140-
TinkerLog.i(TAG, "sync response in update:" + response);
140+
TinkerLog.d(TAG, "sync response in update:" + response);
141141

142142
if (response.isRollback) {
143143
callback.onPatchRollback();
144144
return;
145145
}
146146
if (response.isPaused) {
147-
TinkerLog.i(TAG, "Needn't update, sync response is: " + response.toString()
147+
TinkerLog.d(TAG, "Needn't update, sync response is: " + response.toString()
148148
+ "\ngray: " + versionUtils.grayValue());
149149
return;
150150
}
@@ -172,7 +172,7 @@ context, getAppVersion(), response.version
172172
).getAbsolutePath();
173173
download(response.version, patchPath, downloadCallback);
174174
} else {
175-
TinkerLog.i(TAG, "Needn't update, sync response is: " + response.toString()
175+
TinkerLog.d(TAG, "Needn't update, sync response is: " + response.toString()
176176
+ "\ngray: " + versionUtils.grayValue());
177177
}
178178
}
@@ -212,7 +212,7 @@ public void onDataReady(InputStream data) {
212212
}
213213
try {
214214
String response = ServerUtils.readStreamToString(data, ServerUtils.CHARSET);
215-
TinkerLog.e(TAG, "tinker server sync respond:" + response);
215+
TinkerLog.d(TAG, "tinker server sync respond:" + response);
216216

217217
SyncResponse.fromJson(response);
218218
callback.onDataReady(response);

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Conditions.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Conditions.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public Boolean check(String rules) {
6464
try {
6565
return Helper.calcReversePolish(rpList, properties);
6666
} catch (Exception ignore) {
67-
TinkerLog.e(TAG, "parse conditions error(have you written '==' as '='?): " + rules);
68-
TinkerLog.w(TAG, "exception:" + ignore);
67+
TinkerLog.e(TAG, "parse conditions error(have you written '==' as '='?): " + rules, ignore);
6968
return false;
7069
}
7170
}

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Debugger.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Debugger.java
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,15 @@ private Debugger(final Context context) {
6161
cu = null;
6262
}
6363

64-
if (cu == null) {
64+
if (cu == null || cu.getCount() <= 0) {
6565
TinkerLog.w(TAG, "debugger not attached cu == null");
66+
if (cu != null) {
67+
cu.close();
68+
}
6669
return;
6770
}
6871

69-
if (cu.getCount() <= 0) {
70-
TinkerLog.w(TAG, "debugger not attached cu size == 0");
71-
cu.close();
72-
return;
73-
}
74-
TinkerLog.w(TAG, "debugger attached");
72+
TinkerLog.i(TAG, "debugger attached");
7573

7674
final int keyIdx = cu.getColumnIndex("key");
7775
final int typeIdx = cu.getColumnIndex("type");

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/VersionUtils.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/VersionUtils.java
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,21 @@ public VersionUtils(Context context, String appVersion) {
6969

7070
public boolean isInGrayGroup(Integer gray) {
7171
boolean result = gray == null || gray >= grayValue;
72-
TinkerLog.w(TAG, "isInGrayGroup return %b, gray value:%d and my gray value is %d", result, gray, grayValue);
72+
TinkerLog.d(TAG, "isInGrayGroup return %b, gray value:%d and my gray value is %d", result, gray, grayValue);
7373
return result;
7474
}
7575

7676
public boolean isUpdate(Integer version, String currentAppVersion) {
7777
if (!currentAppVersion.equals(appVersion)) {
78-
TinkerLog.w(TAG, "update return true, appVersion from %s to %s", appVersion, currentAppVersion);
78+
TinkerLog.d(TAG, "update return true, appVersion from %s to %s", appVersion, currentAppVersion);
7979
return true;
8080
}
8181
Integer current = getPatchVersion();
8282
if (version > current) {
83-
TinkerLog.w(TAG, "update return true, patchVersion from %s to %s", current, version);
84-
83+
TinkerLog.d(TAG, "update return true, patchVersion from %s to %s", current, version);
8584
return true;
8685
} else {
87-
TinkerLog.w(TAG, "update return false, target version is not latest. current version is:" + version);
86+
TinkerLog.d(TAG, "update return false, target version is not latest. current version is:" + version);
8887
return false;
8988
}
9089
}
@@ -141,7 +140,7 @@ private void readVersionProperty() {
141140

142141
public void updateVersionProperty(String appVersion, int currentVersion,
143142
String patchMd5, int grayValue, String uuid) {
144-
TinkerLog.i(TAG, "updateVersionProperty file path:"
143+
TinkerLog.d(TAG, "updateVersionProperty file path:"
145144
+ versionFile.getAbsolutePath()
146145
+ " , appVersion: " + appVersion
147146
+ " , patchVersion:" + currentVersion

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.