Skip to content

Commit dc3fbfc

Browse files
simpletonfacebook-github-bot
authored andcommitted
add apk file paths in backup sosource logging
Summary: print the `mZipSources` path list in Backup soSource. Reviewed By: adicatana Differential Revision: D56665839 fbshipit-source-id: d37665c7169890656b13e5ab100046adeb366f35
1 parent d9bd759 commit dc3fbfc

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

java/com/facebook/soloader/BackupSoSource.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,25 @@ public SoSource recover(Context context) {
189189
}
190190
return recovered;
191191
}
192+
193+
@Override
194+
public String toString() {
195+
String path;
196+
try {
197+
path = String.valueOf(soDirectory.getCanonicalPath());
198+
} catch (IOException e) {
199+
path = soDirectory.getName();
200+
}
201+
202+
return new StringBuilder()
203+
.append(getName())
204+
.append("[root = ")
205+
.append(path)
206+
.append(" flags = ")
207+
.append(flags)
208+
.append(" apks = ")
209+
.append(mZipSources.toString())
210+
.append("]")
211+
.toString();
212+
}
192213
}

java/com/facebook/soloader/ExtractFromZipSoSource.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,13 @@ public int hashCode() {
216216
return 31 * result + backingEntry.hashCode();
217217
}
218218
}
219+
220+
@Override
221+
public String toString() {
222+
try {
223+
return mZipFileName.getCanonicalPath();
224+
} catch (IOException e) {
225+
return mZipFileName.getName();
226+
}
227+
}
219228
}

java/com/facebook/soloader/SoLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ private static void initSoSources(Context context, int flags) throws IOException
388388
SoSource[] finalSoSources = soSources.toArray(new SoSource[soSources.size()]);
389389
int prepareFlags = makePrepareFlags();
390390
for (int i = finalSoSources.length; i-- > 0; ) {
391-
LogUtil.d(TAG, "Preparing SO source: " + finalSoSources[i]);
391+
LogUtil.i(TAG, "Preparing SO source: " + finalSoSources[i]);
392392

393393
if (SYSTRACE_LIBRARY_LOADING) {
394394
Api18TraceUtils.beginTraceSection(TAG, "_", finalSoSources[i].getClass().getSimpleName());
@@ -400,7 +400,7 @@ private static void initSoSources(Context context, int flags) throws IOException
400400
}
401401
sSoSources = finalSoSources;
402402
sSoSourcesVersion.getAndIncrement();
403-
LogUtil.d(TAG, "init finish: " + sSoSources.length + " SO sources prepared");
403+
LogUtil.i(TAG, "init finish: " + sSoSources.length + " SO sources prepared");
404404
} finally {
405405
sSoSourcesLock.writeLock().unlock();
406406
}

0 commit comments

Comments
 (0)