func LogError(rw http.ResponseWriter, err error) {
	if rl, ok := rw.(logging.ResponseLogger); ok {
		rl.WithFields(map[string]interface{}{
			"error": err,
		})
	} else {
		log.Println(err)
	}
}
LogError adds to the response writer the given error if it implements
logging.ResponseLogger. If it does not implement it, then writes the error
using the log package.
package api
import (
	"encoding/json"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"github.com/smallstep/certificates/errs"
	"github.com/smallstep/certificates/logging"
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/proto"
)
type EnableLogger interface {
	ToLog() (interface{}, error)
}