aboutsummaryrefslogtreecommitdiff
path: root/pkg/instance/handler.go
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-05-17 13:56:53 +0200
committerLinus Nordberg <linus@nordberg.se>2022-05-17 13:56:53 +0200
commit45d7f7875ce885369b1d1aecc644875cf6bbfdba (patch)
treef015e5012ee9c5c2d843a947cee1b4edbb4f2714 /pkg/instance/handler.go
parentf7aac347caf5e2aaa91921102ebed158b8ba9c27 (diff)
parentc10a9103f959498c360be002b2621e978bb82e19 (diff)
Merge remote-tracking branch 'origin/merge/glog-to-log'
Diffstat (limited to 'pkg/instance/handler.go')
-rw-r--r--pkg/instance/handler.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/instance/handler.go b/pkg/instance/handler.go
index ecc22e2..fa465ee 100644
--- a/pkg/instance/handler.go
+++ b/pkg/instance/handler.go
@@ -6,8 +6,8 @@ import (
"net/http"
"time"
+ "git.sigsum.org/sigsum-go/pkg/log"
"git.sigsum.org/sigsum-go/pkg/types"
- "github.com/golang/glog"
)
// Handler implements the http.Handler interface, and contains a reference
@@ -72,14 +72,14 @@ func (h Handler) handle(w http.ResponseWriter, r *http.Request) int {
code, err := h.Handler(ctx, h.Instance, w, r)
if err != nil {
- glog.V(3).Infof("%s/%s: %v", h.Instance.Prefix, h.Endpoint, err)
+ log.Debug("%s/%s: %v", h.Instance.Prefix, h.Endpoint, err)
http.Error(w, fmt.Sprintf("error=%s", err.Error()), code)
}
return code
}
func addLeaf(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) {
- glog.V(3).Info("handling add-entry request")
+ log.Debug("handling add-leaf request")
req, err := i.leafRequestFromHTTP(ctx, r)
if err != nil {
return http.StatusBadRequest, err
@@ -91,7 +91,7 @@ func addLeaf(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Re
}
func addCosignature(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) {
- glog.V(3).Info("handling add-cosignature request")
+ log.Debug("handling add-cosignature request")
req, err := i.cosignatureRequestFromHTTP(r)
if err != nil {
return http.StatusBadRequest, err
@@ -104,7 +104,7 @@ func addCosignature(ctx context.Context, i *Instance, w http.ResponseWriter, r *
}
func getTreeHeadToCosign(ctx context.Context, i *Instance, w http.ResponseWriter, _ *http.Request) (int, error) {
- glog.V(3).Info("handling get-tree-head-to-cosign request")
+ log.Debug("handling get-tree-head-to-cosign request")
sth, err := i.Stateman.ToCosignTreeHead(ctx)
if err != nil {
return http.StatusInternalServerError, err
@@ -116,7 +116,7 @@ func getTreeHeadToCosign(ctx context.Context, i *Instance, w http.ResponseWriter
}
func getTreeHeadCosigned(ctx context.Context, i *Instance, w http.ResponseWriter, _ *http.Request) (int, error) {
- glog.V(3).Info("handling get-tree-head-cosigned request")
+ log.Debug("handling get-tree-head-cosigned request")
cth, err := i.Stateman.CosignedTreeHead(ctx)
if err != nil {
return http.StatusInternalServerError, err
@@ -128,7 +128,7 @@ func getTreeHeadCosigned(ctx context.Context, i *Instance, w http.ResponseWriter
}
func getConsistencyProof(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) {
- glog.V(3).Info("handling get-consistency-proof request")
+ log.Debug("handling get-consistency-proof request")
req, err := i.consistencyProofRequestFromHTTP(r)
if err != nil {
return http.StatusBadRequest, err
@@ -146,7 +146,7 @@ func getConsistencyProof(ctx context.Context, i *Instance, w http.ResponseWriter
}
func getInclusionProof(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) {
- glog.V(3).Info("handling get-proof-by-hash request")
+ log.Debug("handling get-inclusion-proof request")
req, err := i.inclusionProofRequestFromHTTP(r)
if err != nil {
return http.StatusBadRequest, err
@@ -164,7 +164,7 @@ func getInclusionProof(ctx context.Context, i *Instance, w http.ResponseWriter,
}
func getLeaves(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) {
- glog.V(3).Info("handling get-leaves request")
+ log.Debug("handling get-leaves request")
req, err := i.leavesRequestFromHTTP(r)
if err != nil {
return http.StatusBadRequest, err