stasher: log when a stash event occurs (#1518)

* stasher: log when a stash event occurs

* rm space
This commit is contained in:
Marwan Sulaiman
2020-01-09 18:15:37 -05:00
committed by Aaron Schlesinger
parent c695a41fef
commit 0b649557bb
+2
View File
@@ -5,6 +5,7 @@ import (
"time" "time"
"github.com/gomods/athens/pkg/errors" "github.com/gomods/athens/pkg/errors"
"github.com/gomods/athens/pkg/log"
"github.com/gomods/athens/pkg/module" "github.com/gomods/athens/pkg/module"
"github.com/gomods/athens/pkg/observ" "github.com/gomods/athens/pkg/observ"
"github.com/gomods/athens/pkg/storage" "github.com/gomods/athens/pkg/storage"
@@ -44,6 +45,7 @@ func (s *stasher) Stash(ctx context.Context, mod, ver string) (string, error) {
const op errors.Op = "stasher.Stash" const op errors.Op = "stasher.Stash"
_, span := observ.StartSpan(ctx, op.String()) _, span := observ.StartSpan(ctx, op.String())
defer span.End() defer span.End()
log.EntryFromContext(ctx).Debugf("saving %s@%s to storage...", mod, ver)
// create a new context that ditches whatever deadline the caller passed // create a new context that ditches whatever deadline the caller passed
// but keep the tracing info so that we can properly trace the whole thing. // but keep the tracing info so that we can properly trace the whole thing.