Skip to content

Commit

Permalink
more logging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
scermat committed Jul 26, 2024
1 parent ff22be6 commit 37cb8fe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion gateway/common/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Instrument struct {
}

func UpdateContext(ctx context.Context, entity Contextable) context.Context {
log.Info("context.go > UpdateContext > Updating context", "entity", entity.ContextKey())
log.Info("*** Updating context ***", "entity", entity)
return context.WithValue(ctx, entity.ContextKey(), entity)
}

Expand Down
7 changes: 0 additions & 7 deletions gateway/db/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func NewUsageUpdater(ctx context.Context, status string) *UsageUpdater {
log.Info("usage.go > NewUsageUpdater > retrieved product entity", "product", updater.product)
}

logContext(ctx)
log.Info("usage.go > NewUsageUpdater > Attempting to read app from context")
entity, ok = common.FromContext(ctx, APP)
if !ok || entity == nil {
Expand Down Expand Up @@ -74,12 +73,6 @@ func NewUsageUpdater(ctx context.Context, status string) *UsageUpdater {
return updater
}

func logContext(ctx context.Context) {
for k, v := range ctx.Value(ctx).(map[string]interface{}) {
log.Info("context value", "key", k, "value", v)
}
}

func (u *UsageUpdater) Run() {
if u.app == nil || u.tenant == nil || u.product == nil {
log.Error("usage.go > UsageUpdated > Invalid request, usage not reported", "app", u.app, "tenant", u.tenant, "product", u.product)
Expand Down

0 comments on commit 37cb8fe

Please sign in to comment.