Added additional parameters for logging

Summary:
The navigation plugin supports logging of a date and the class name. This addition adds that support.

I have kept the previoius method which I will remove once  I update the fb4a navigation plugin integration.

Reviewed By: danielbuechele

Differential Revision: D17202996

fbshipit-source-id: eac95328a6e2278c3a27ca608b9b675c8efe4528
This commit is contained in:
Benjamin Elo
2019-09-05 05:57:48 -07:00
committed by Facebook Github Bot
parent 4e71d9b1ea
commit a90422bf2f
2 changed files with 15 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import com.facebook.flipper.core.FlipperObject;
import com.facebook.flipper.core.FlipperPlugin;
import com.facebook.flipper.core.FlipperReceiver;
import com.facebook.flipper.core.FlipperResponder;
import java.util.Date;
public class NavigationFlipperPlugin implements FlipperPlugin {
@@ -21,9 +22,21 @@ public class NavigationFlipperPlugin implements FlipperPlugin {
private NavigationFlipperPlugin() {}
@Deprecated
public void sendNavigationEvent(@Nullable String keyURI) {
sendNavigationEvent(keyURI, null, null);
}
public void sendNavigationEvent(
@Nullable String keyURI, @Nullable String className, @Nullable Date date) {
if (mConnection != null) {
mConnection.send("nav_event", new FlipperObject.Builder().put("uri", keyURI).build());
FlipperObject sendObject =
new FlipperObject.Builder()
.put("uri", keyURI)
.put("date", date != null ? date : new Date())
.put("class", className)
.build();
mConnection.send("nav_event", sendObject);
}
}