Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wregglesworth committed Sep 12, 2024
1 parent 073af42 commit 03c50ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ func (a *App) GetUserSummary(ctx context.Context, username string) (*qms.Subscri
return nil, err
}
err = tx.Wrap(func() error {
log.Debug("before getting the active user plan")
log.Debugf("before getting the active user plan: %s", username)

subscription, err = d.GetActiveSubscription(ctx, username, db.WithTX(tx))
if err != nil {
log.Errorf("unable to get the active user plan: %s", err)
return err
}
log.Debug("after getting the active user plan")
log.Debugf("after getting the active user plan: %s", username)

if subscription == nil || subscription.ID == "" {
user, err := d.EnsureUser(ctx, username, db.WithTX(tx))
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func main() {
log.Fatal("users.domain must be set in the configuration file")
}

log.Infof("username suffix is configured as %s", userSuffix)

natsCluster := config.String("nats.cluster")
if natsCluster == "" {
log.Fatalf("The %sNATS_CLUSTER environment variable or nats.cluster configuration value must be set", *envPrefix)
Expand Down

0 comments on commit 03c50ac

Please sign in to comment.