From 6083ead850c54dc8e41c03e144c4f89b6da86ffd Mon Sep 17 00:00:00 2001 From: Serhii Olshanivskyi Date: Tue, 28 Nov 2023 12:40:40 +0200 Subject: [PATCH] feat: delete redundant logs --- services/watcher/handler.go | 2 -- services/watcher/repository.go | 2 -- services/watcher/service.go | 10 ---------- 3 files changed, 14 deletions(-) diff --git a/services/watcher/handler.go b/services/watcher/handler.go index 0ee2456..5e334f3 100644 --- a/services/watcher/handler.go +++ b/services/watcher/handler.go @@ -3,7 +3,6 @@ package watcher import ( "errors" "net/url" - "fmt" "github.com/gofiber/fiber/v2" ) @@ -50,7 +49,6 @@ func (h *Handler) GetWatcherHandler(c *fiber.Ctx) error { return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()}) } - fmt.Printf("GetWatcherHandler -> watcher: %+v\n", watcher) return c.JSON(watcher) } diff --git a/services/watcher/repository.go b/services/watcher/repository.go index 2d80d76..1662d0e 100644 --- a/services/watcher/repository.go +++ b/services/watcher/repository.go @@ -3,7 +3,6 @@ package watcher import ( "context" "errors" - "fmt" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -83,7 +82,6 @@ func (r *repository) GetWatcherList(ctx context.Context, filters bson.M, page in watchers = append(watchers, &watcher) } - fmt.Printf("GetWatcherList -> watchers: %v\n", watchers) // Check for any errors that occurred during iteration if err := cur.Err(); err != nil { diff --git a/services/watcher/service.go b/services/watcher/service.go index c36beaa..23d3c5d 100644 --- a/services/watcher/service.go +++ b/services/watcher/service.go @@ -293,7 +293,6 @@ func (s *service) PriceWatch(ctx context.Context, watcherId string, stopChan cha body := fmt.Sprintf("🚀 AMB Price changed on +%v%s! Current price $%v\n", roundedPercentage, "%", roundedPrice) sent := false - fmt.Printf("Title: %s, Body: %s, Token: %s, Data: %+v\n", title, body, string(decodedPushToken), data) response, err := s.cloudMessagingSvc.SendMessage(ctx, title, body, string(decodedPushToken), data) if err != nil { s.logger.Errorf("PriceWatch (Up) cloudMessagingSvc.SendMessage error %v\n", err) @@ -323,7 +322,6 @@ func (s *service) PriceWatch(ctx context.Context, watcherId string, stopChan cha body := fmt.Sprintf("🔻 AMB Price changed on -%v%s! Current price $%v\n", roundedPercentage, "%", roundedPrice) sent := false - fmt.Printf("Title: %s, Body: %s, Token: %s, Data: %+v\n", title, body, string(decodedPushToken), data) response, err := s.cloudMessagingSvc.SendMessage(ctx, title, body, string(decodedPushToken), data) if err != nil { s.logger.Errorf("PriceWatch (Down) cloudMessagingSvc.SendMessage error %v\n", err) @@ -336,7 +334,6 @@ func (s *service) PriceWatch(ctx context.Context, watcherId string, stopChan cha sent = true } - fmt.Printf("AddNotification, PriceWatch: title: %v, body: %v, sent: %t, time: %v\n", title, body, sent, time.Now()) watcher.AddNotification(title, body, sent, time.Now()) } @@ -417,7 +414,6 @@ func (s *service) TransactionWatch(ctx context.Context, address string, txHash s body := fmt.Sprintf("From: %s\nTo: %s\nAmount: %s %s", cutFromAddress, cutToAddress, roundedAmount, tokenSymbol) sent := false - fmt.Printf("Title: %s, Body: %s, Token: %s, Data: %+v\n", title, body, string(decodedPushToken), data) response, err := s.cloudMessagingSvc.SendMessage(ctx, title, body, string(decodedPushToken), data) if err != nil { s.logger.Errorf("TransactionWatch cloudMessagingSvc.SendMessage error %v\n", err) @@ -433,10 +429,8 @@ func (s *service) TransactionWatch(ctx context.Context, address string, txHash s sent = true } - fmt.Printf("AddNotification, TransactionWatch: title: %v, body: %v, sent: %t, time: %v\n", title, body, sent, time.Now()) watcher.AddNotification(title, body, sent, time.Now()) - fmt.Printf("Tx notify: %v:%v\n", txHash, watcher.PushToken) cache[itemId] = true } @@ -471,7 +465,6 @@ func (s *service) GetWatcher(ctx context.Context, pushToken string) (*Watcher, e return nil, errors.New("watcher not found") } - fmt.Printf("GetWatcher -> watcher %v\n", watcher) s.mx.Lock() s.cachedWatcher[encodePushToken] = watcher @@ -496,7 +489,6 @@ func (s *service) CreateWatcher(ctx context.Context, pushToken string) error { return errors.New("watcher for this address and token already exist") } - fmt.Printf("GetWatcherHistoryPrices -> dbWatcher %v\n", dbWatcher) watcher, err := NewWatcher(encodePushToken) if err != nil { @@ -520,7 +512,6 @@ func (s *service) CreateWatcher(ctx context.Context, pushToken string) error { return err } - fmt.Printf("GetWatcherHistoryPrices -> watcher after repository create %v\n", dbWatcher) s.mx.Lock() s.cachedWatcher[watcher.PushToken] = watcher @@ -540,7 +531,6 @@ func (s *service) UpdateWatcher(ctx context.Context, pushToken string, addresses return errors.New("watcher not found") } - fmt.Printf("UpdateWatcher(%v, %v, %v, %v, %v)\n", pushToken, addresses, threshold, txNotification, priceNotification) if addresses != nil && len(*addresses) > 0 { var req bytes.Buffer