Skip to content

Commit

Permalink
Add callercontext to stetho logging
Browse files Browse the repository at this point in the history
Reviewed By: massimocarli

Differential Revision: D3288676

fbshipit-source-id: 9a3feb02452f61b0b39e2d0aeaa262f77239d4e0
  • Loading branch information
aagnes-zz authored and Facebook Github Bot 1 committed May 12, 2016
1 parent 1def030 commit 96d67ba
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.facebook.cache.common.CacheKey;
import com.facebook.cache.disk.DiskStorage;
import com.facebook.cache.disk.FileCache;
import com.facebook.imagepipeline.cache.BitmapMemoryCacheKey;
import com.facebook.imagepipeline.cache.CountingMemoryCacheInspector;
import com.facebook.imagepipeline.core.ImagePipelineFactory;
import com.facebook.imagepipeline.image.CloseableBitmap;
Expand Down Expand Up @@ -214,12 +215,16 @@ private void writeDiskDumpEntryScriptReadable(
private void writeCacheEntry(
PrintStream writer,
CountingMemoryCacheInspector.DumpInfoEntry<CacheKey, CloseableImage> entry) {
if (!(entry.key instanceof BitmapMemoryCacheKey)) {
writer.println("Undefined: " + entry.key.getClass());
}
writer.println(formatStrLocaleSafe(
"size: %7.2fkB (%4d x %4d) key: %s",
"size: %7.2fkB (%4d x %4d) key: %s, %s",
entry.value.get().getSizeInBytes() / KB,
entry.value.get().getWidth(),
entry.value.get().getHeight(),
entry.key));
entry.key,
((BitmapMemoryCacheKey) entry.key).getCallerContext()));
}

private void memcache(PrintStream writer, List<String> args) throws DumpException {
Expand Down

0 comments on commit 96d67ba

Please sign in to comment.