remove sentry and move to slog
This commit is contained in:
parent
a20bc22ab1
commit
5d2b8f39d9
18 changed files with 134 additions and 232 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
@ -15,15 +15,17 @@ type EpicStruct struct {
|
|||
idPrefix string
|
||||
headers map[string]string
|
||||
deals DealsMap
|
||||
logger *slog.Logger
|
||||
}
|
||||
|
||||
func NewEpicApi() EpicStruct {
|
||||
func NewEpicApi(logger *slog.Logger) EpicStruct {
|
||||
epic := EpicStruct{
|
||||
url: "https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions",
|
||||
baseUrl: "https://store.epicgames.com/p/",
|
||||
idPrefix: "epic-",
|
||||
headers: make(map[string]string),
|
||||
deals: make(map[string]Deal),
|
||||
logger: logger,
|
||||
}
|
||||
epic.headers["Accept-Language"] = "en"
|
||||
epic.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0"
|
||||
|
@ -113,7 +115,7 @@ func (e EpicStruct) Load() error {
|
|||
productSlug = element.OfferMappings[0].PageSlug
|
||||
}
|
||||
if productSlug == "" {
|
||||
log.Printf("ERROR: product slug not found for: %v", element.Title)
|
||||
e.logger.Error("product slug not found", slog.String("title", element.Title))
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue