Add logger interface and stop relying on Logrus directly

This commit is contained in:
Mark Sagi-Kazar
2019-02-22 13:19:23 +01:00
parent ca66289077
commit be581fa7ff
38 changed files with 203 additions and 133 deletions

View File

@@ -6,8 +6,8 @@ import (
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3/namespace"
"github.com/coreos/etcd/pkg/transport"
"github.com/sirupsen/logrus"
"github.com/dexidp/dex/pkg/log"
"github.com/dexidp/dex/storage"
)
@@ -36,11 +36,11 @@ type Etcd struct {
}
// Open creates a new storage implementation backed by Etcd
func (p *Etcd) Open(logger logrus.FieldLogger) (storage.Storage, error) {
func (p *Etcd) Open(logger log.Logger) (storage.Storage, error) {
return p.open(logger)
}
func (p *Etcd) open(logger logrus.FieldLogger) (*conn, error) {
func (p *Etcd) open(logger log.Logger) (*conn, error) {
cfg := clientv3.Config{
Endpoints: p.Endpoints,
DialTimeout: defaultDialTimeout,