feat:use global anchor hook to print log

This commit is contained in:
pengfei.zhou
2021-07-20 11:29:53 +08:00
committed by osborn
parent 17e14e7119
commit a021aae3de
9 changed files with 71 additions and 43 deletions

View File

@@ -65,6 +65,10 @@ public class DoricPerformanceProfile {
this.name = name;
}
public String getName() {
return this.name;
}
public void addAnchorHook(AnchorHook hook) {
this.hooks.add(hook);
}
@@ -136,8 +140,6 @@ public class DoricPerformanceProfile {
if (prepare == null) {
prepare = start;
}
Log.d(TAG, String.format("%s: %s prepared %dms, cost %dms.",
name, anchorName, start - prepare, end - start));
for (AnchorHook hook : hooks) {
if (hook instanceof GlobalAnchorHook) {
((GlobalAnchorHook) hook).onAnchor(DoricPerformanceProfile.this, anchorName, prepare, start, end);