package io.github.droidkaigi.confsched2017.view.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import javax.inject.Inject;

import io.github.droidkaigi.confsched2017.databinding.FragmentContributorsBinding;
import io.github.droidkaigi.confsched2017.model.Contributor;
import io.github.droidkaigi.confsched2017.viewmodel.ContributorsViewModel;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;

public class ContributorsFragment extends BaseFragment {

    public static final String TAG = ContributorsFragment.class.getSimpleName();

    @Inject
    ContributorsViewModel viewModel;

    @Inject
    CompositeDisposable compositeDisposable;

    private FragmentContributorsBinding binding;

    public static ContributorsFragment newInstance() {
        return new ContributorsFragment();
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        getComponent().inject(this);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Disposable disposable = viewModel.getContributors()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(
                        this::renderContributors,
                        throwable -> Log.e(TAG, "Failed to find contributors.", throwable)
                );
        compositeDisposable.add(disposable);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentContributorsBinding.inflate(inflater, container, false);
        binding.setViewModel(viewModel);

        initView();
        return binding.getRoot();
    }

    @Override
    public void onStop() {
        super.onStop();
        compositeDisposable.dispose();
    }

    private void initView() {
        //
    }

    private void renderContributors(List<Contributor> contributors) {
        // TODO render contributors
    }
}

@@ -158,33 +158,8 @@
 le;%0A
-import android.util.Log;%0A
 impo
@@ -674,16 +674,42 @@
 posable;
+%0Aimport timber.log.Timber;
 %0A%0Apublic
@@ -1600,60 +1600,63 @@
  -%3E 
-Log.e(TAG, %22Failed to find contributors.%22, throwable
+Timber.tag(TAG).e(throwable, %22Failed to show sessions.%22
 )%0A  

Use timber instead of using Log