@Override
  public void println(int logLevel, String tag, String msg) {
    // Append the log the the recycler view.
    adapter.addLog(new LogItem(System.currentTimeMillis(), logLevel, tag, msg));

    // Scroll to the bottom so we can see the newly-printed log.
    recyclerView.scrollToPosition(adapter.getItemCount() - 1);
  }
Display logs in a {@link androidx.recyclerview.widget.RecyclerView}.
xlog-sample/src/main/java/com/elvishew/xlogsample/RecyclerViewPrinter.java