uncomment log
This commit is contained in:
parent
156fa24a1e
commit
5d0b758f15
3 changed files with 8 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -9,4 +9,5 @@ pkg/
|
||||||
.idea
|
.idea
|
||||||
.skaffold-*.yaml
|
.skaffold-*.yaml
|
||||||
.kubernetes-manifests-*/
|
.kubernetes-manifests-*/
|
||||||
.project
|
.project
|
||||||
|
.eclipse.buildship.core.prefs
|
|
@ -72,13 +72,13 @@ type checkoutService struct {
|
||||||
func main() {
|
func main() {
|
||||||
stats, err := getenvBool("STATS")
|
stats, err := getenvBool("STATS")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugf("Could not get STATS var: %v, defaulting to True", err)
|
log.Infof("Could not get STATS var: %v, defaulting to True", err)
|
||||||
stats = true
|
stats = true
|
||||||
}
|
}
|
||||||
|
|
||||||
trace, err := getenvBool("TRACE")
|
trace, err := getenvBool("TRACE")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugf("Could not get TRACE var: %v, defaulting to True", err)
|
log.Infof("Could not get TRACE var: %v, defaulting to True", err)
|
||||||
trace = true
|
trace = true
|
||||||
}
|
}
|
||||||
if trace == true {
|
if trace == true {
|
||||||
|
@ -90,7 +90,7 @@ func main() {
|
||||||
|
|
||||||
profiler, err := getenvBool("PROFILER")
|
profiler, err := getenvBool("PROFILER")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugf("Could not get PROFILER var: %v, defaulting to True", err)
|
log.Infof("Could not get PROFILER var: %v, defaulting to True", err)
|
||||||
profiler = true
|
profiler = true
|
||||||
}
|
}
|
||||||
if profiler == true {
|
if profiler == true {
|
||||||
|
@ -257,7 +257,7 @@ func (cs *checkoutService) PlaceOrder(ctx context.Context, req *pb.PlaceOrderReq
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to charge card: %+v", err)
|
return nil, status.Errorf(codes.Internal, "failed to charge card: %+v", err)
|
||||||
}
|
}
|
||||||
log.Debugf("payment went through (transaction_id: %s)", txID)
|
log.Infof("payment went through (transaction_id: %s)", txID)
|
||||||
|
|
||||||
shippingTrackingID, err := cs.shipOrder(ctx, req.Address, prep.cartItems)
|
shippingTrackingID, err := cs.shipOrder(ctx, req.Address, prep.cartItems)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -277,7 +277,7 @@ func (cs *checkoutService) PlaceOrder(ctx context.Context, req *pb.PlaceOrderReq
|
||||||
if err := cs.sendOrderConfirmation(ctx, req.Email, orderResult); err != nil {
|
if err := cs.sendOrderConfirmation(ctx, req.Email, orderResult); err != nil {
|
||||||
log.Warnf("failed to send order confirmation to %q: %+v", req.Email, err)
|
log.Warnf("failed to send order confirmation to %q: %+v", req.Email, err)
|
||||||
} else {
|
} else {
|
||||||
// log.Infof("order confirmation email sent to %q", req.Email)
|
log.Infof("order confirmation email sent to %q", req.Email)
|
||||||
}
|
}
|
||||||
resp := &pb.PlaceOrderResponse{Order: orderResult}
|
resp := &pb.PlaceOrderResponse{Order: orderResult}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
|
|
@ -75,7 +75,7 @@ class RecommendationService(demo_pb2_grpc.RecommendationServiceServicer):
|
||||||
indices = random.sample(range(num_products), num_return)
|
indices = random.sample(range(num_products), num_return)
|
||||||
# fetch product ids from indices
|
# fetch product ids from indices
|
||||||
prod_list = [filtered_products[i] for i in indices]
|
prod_list = [filtered_products[i] for i in indices]
|
||||||
# logger.info("[Recv ListRecommendations] product_ids={}".format(prod_list))
|
logger.info("[Recv ListRecommendations] product_ids={}".format(prod_list))
|
||||||
# build and return response
|
# build and return response
|
||||||
response = demo_pb2.ListRecommendationsResponse()
|
response = demo_pb2.ListRecommendationsResponse()
|
||||||
response.product_ids.extend(prod_list)
|
response.product_ids.extend(prod_list)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue