code: public static <T> Observer<? super T> log() {
          return new Observer<T>() {
  
              @Override
              public void onCompleted() {
                  // do nothing
              }
  
              @Override
              public void onError(Throwable e) {
                  log.error(e.getMessage(), e);
              }
  
              @Override
              public void onNext(T t) {
                  log.info(t + "");
              }
          };
      }
docs: Logs errors and onNext at info level using slf4j {@link Logger}.
  
  @param <T>
  the return generic type
  @return a logging {@link Observer}