Skip to content

Commit

Permalink
Remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelreiswildlife committed Sep 21, 2023
1 parent d4cebbd commit fe47ea0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 6 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package config

import (
"encoding/json"
"fmt"
"reflect"
"strconv"
"strings"

"github.com/mitchellh/mapstructure"
Expand Down Expand Up @@ -84,15 +84,11 @@ func StringToMapBoolHookFunc() mapstructure.DecodeHookFunc {
return data, nil
}

fmt.Println(" ====> executing string to map bool hook func <====")

raw := data.(string)
if raw == "" {
return map[string]bool{}, nil
}

fmt.Println(" ====> raw: ", raw)

unmarshalled := map[string]string{}
err := json.Unmarshal([]byte(raw), &unmarshalled)
if err != nil {
Expand All @@ -101,7 +97,11 @@ func StringToMapBoolHookFunc() mapstructure.DecodeHookFunc {

result := map[string]bool{}
for k, v := range unmarshalled {
result[k] = v == "true"
boolValue, err := strconv.ParseBool(v)
if err != nil {
continue
}
result[k] = boolValue
}

return result, err
Expand Down
8 changes: 1 addition & 7 deletions leaderboard/enriching/enricher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"net/http"
"net/url"
"os"
"strings"
"time"

Expand All @@ -34,7 +33,7 @@ type (
}

CloudSaveConfig struct {
// Enabled indicates wheter the Cloud Save service should be used for enrichment.
// Enabled indicates whether the Cloud Save service should be used for enrichment.
Disabled map[string]bool `mapstructure:"disabled"`

// URL is the URL to call the Cloud Save service.
Expand All @@ -50,11 +49,6 @@ type enricherImpl struct {

// NewEnricher returns a new Enricher implementation.
func NewEnricher(config EnrichmentConfig, logger *zap.Logger) Enricher {
b, _ := json.Marshal(config)
logger.Info(fmt.Sprintf("enrichment config: %s", string(b)))

disabled := os.Getenv("PODIUM_ENRICHMENT_CLOUD_SAVE_DISABLED")
logger.Info(fmt.Sprintf("enrichment cloud save disabled: %s", disabled))
return &enricherImpl{
config: config,
logger: logger,
Expand Down

0 comments on commit fe47ea0

Please sign in to comment.