Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #108 from DRK3/RemoveLogrusFromHealthCheck
Browse files Browse the repository at this point in the history
refactor: Replace logrus with edge-core logging in health check code
  • Loading branch information
Derek Trider authored Aug 27, 2020
2 parents 4940e3a + da0ceb3 commit 2956198
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pkg/restapi/healthcheck/operation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ import (
"net/http"
"time"

log "github.com/sirupsen/logrus"
"github.com/trustbloc/edge-core/pkg/log"

"github.com/trustbloc/edv/pkg/internal/common/support"
)

// API endpoints.
const (
logModuleName = "edv-healthcheck-restapi"
healthCheckEndpoint = "/healthcheck"
)

var logger = log.New(logModuleName)

type healthCheckResp struct {
Status string `json:"status"`
CurrentTime time.Time `json:"currentTime"`
Expand Down Expand Up @@ -56,6 +59,6 @@ func (o *Operation) healthCheckHandler(rw http.ResponseWriter, r *http.Request)
CurrentTime: time.Now(),
})
if err != nil {
log.Errorf("healthcheck response failure, %s", err)
logger.Errorf("healthcheck response failure, %s", err)
}
}
1 change: 0 additions & 1 deletion test/bdd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
github.com/google/tink/go v0.0.0-20200403150819-3a14bf4b3380
github.com/google/uuid v1.1.1
github.com/hyperledger/aries-framework-go v0.1.3
github.com/sirupsen/logrus v1.4.2
github.com/tidwall/gjson v1.6.0
github.com/trustbloc/edge-core v0.1.4-0.20200826135230-320b0953ce08
github.com/trustbloc/edv v0.0.0-00010101000000-000000000000
Expand Down
4 changes: 3 additions & 1 deletion test/bdd/pkg/common/common_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (
"net/http"

"github.com/cucumber/godog"
logger "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
"github.com/trustbloc/edge-core/pkg/log"

"github.com/trustbloc/edv/test/bdd/pkg/context"
)

var logger = log.New("edv-bddtest-common")

// Steps is steps for VC BDD tests.
type Steps struct {
bddContext *context.BDDContext
Expand Down

0 comments on commit 2956198

Please sign in to comment.