2

How do I integrate Shipbook remote logging platform with Timber in android?

I've done the following code:

Timber.plant(new Timber.Tree() {

  @Override

  protected void log(int priority, @Nullable String tag, @NotNull String message, @Nullable Throwable t) {

    Log.message(tag, message, priority, t);

  }

});

The problem is that the Loglytics in Shipbook is seeing all logs as the same log and isn't differentiating between logs.

Moshe Gottlieb
  • 3,963
  • 25
  • 41

1 Answers1

2

You need to tell to Shipbook that Timber and your Timber Tree class are wrapper classes with ShipBook.addWrapperClass.

Just write the following code:


ShipBook.addWrapperClass(Timber.class.getName());

Timber.plant(new Timber.Tree() {

    {

      ShipBook.addWrapperClass(this.getClass().getName());

    }


    @Override

    protected void log(int priority, @Nullable String tag, @NotNull String message, @Nullable Throwable t) {

        Log.message(tag, message, priority, t);

    }

});

Good luck

Yedidya Reiss
  • 5,316
  • 2
  • 17
  • 19