Skip to content

Commit

Permalink
remove useless logs
Browse files Browse the repository at this point in the history
  • Loading branch information
coddmeistr committed Dec 23, 2024
1 parent e84d829 commit 09aeb83
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions pkg/billing/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,14 @@ func (s *BillingServiceServer) ListPlans(ctx context.Context, r *connect.Request
if !req.Anonymously {
requestor = ctx.Value(nocloud.NoCloudAccount).(string)
}
log.Debug("Request received", zap.Any("request", req), zap.String("requestor", requestor))
log.Debug("Request received", zap.String("requestor", requestor))
ok := s.ca.HasAccess(ctx, requestor, driver.NewDocumentID(schema.NAMESPACES_COL, schema.ROOT_NAMESPACE_KEY), access.Level_ROOT)

if req.GetUuid() != "" {
return s._HandleGetSinglePlan(ctx, r)
}

query, vars := buildPlansListQuery(req, ok)
log.Debug("Ready to retrieve plans", zap.String("query", query), zap.Any("vars", vars))
req.Limit = nil
req.Page = nil
countQuery, countVars := buildPlansListQuery(req, ok)
Expand Down Expand Up @@ -727,7 +726,6 @@ func (s *BillingServiceServer) ListPlans(ctx context.Context, r *connect.Request
graph.ConvertPlan(plan, rate, cur.Precision, cur.Rounding)
}

log.Debug("Plans retrieved", zap.Any("plans", plans), zap.Int("count", len(plans)), zap.Int("total", count))
resp := connect.NewResponse(&pb.ListResponse{Pool: plans, Total: uint64(count)})
graph.ExplicitSetPrimaryCurrencyHeader(resp.Header(), cur.Code)
return resp, nil
Expand All @@ -738,7 +736,6 @@ func (s *BillingServiceServer) ListPlans(ctx context.Context, r *connect.Request
conv.ConvertObjectPrices(plan)
}

log.Debug("Plans retrieved", zap.Any("plans", plans), zap.Int("count", len(plans)), zap.Int("total", count))
resp := connect.NewResponse(&pb.ListResponse{Pool: plans, Total: uint64(count)})
conv.SetResponseHeader(resp.Header())
return graph.HandleConvertionError(resp, conv)
Expand Down
4 changes: 1 addition & 3 deletions pkg/billing/invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (s *BillingServiceServer) GetInvoices(ctx context.Context, r *connect.Reque
requester := ctx.Value(nocloud.NoCloudAccount).(string)

req := r.Msg
log.Debug("Request received", zap.Any("request", req), zap.String("requester", requester))
log.Debug("Request received", zap.String("requester", requester))

acc := requester

Expand Down Expand Up @@ -312,8 +312,6 @@ FILTER LOWER(t["number"]) LIKE LOWER("%s") || t._key LIKE "%s" || t.meta["whmcs_
}
query += ` RETURN merge(t, {uuid: t._key, currency: DOCUMENT(@@currencies, TO_STRING(TO_NUMBER(t.currency.id)))})`

log.Debug("Ready to retrieve invoices", zap.String("query", query), zap.Any("vars", vars))

cursor, err := s.db.Query(ctx, query, vars)
if err != nil {
log.Error("Failed to retrieve invoices", zap.Error(err))
Expand Down
2 changes: 0 additions & 2 deletions pkg/graph/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ func (ctrl *billingPlansController) List(ctx context.Context, spUuid string, uui
}
query = fmt.Sprintf(query, filters)

ctrl.log.Debug("Ready to build query", zap.Any("bindVars", bindVars))

c, err := ctrl.col.Database().Query(ctx, query, bindVars)
if err != nil {
return nil, err
Expand Down

0 comments on commit 09aeb83

Please sign in to comment.