From 40d7890c883f68465a7c92d6baa041b70ee46654 Mon Sep 17 00:00:00 2001 From: Marilou Farmer <122293023+mariloufarmer@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:41:16 -0400 Subject: [PATCH] feat: log schema (#8) * feat: log schema * Update internal/schema/schema.go Co-authored-by: Dannick B. Senss <44579430+Bsenss6@users.noreply.github.com> --------- Co-authored-by: Dannick B. Senss <44579430+Bsenss6@users.noreply.github.com> --- internal/schema/schema.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/schema/schema.go b/internal/schema/schema.go index 3118a72..7090c09 100644 --- a/internal/schema/schema.go +++ b/internal/schema/schema.go @@ -25,10 +25,12 @@ func ExtractReadOnlyTraits(url string) (map[string]bool, error) { return nil, err } if resp.StatusCode < 200 || resp.StatusCode > 299 { + log.Error().Msg(fmt.Sprintf("Failed to get schema (%d) with body: %s", resp.StatusCode, string(body[:]))) return nil, fmt.Errorf("%d: %s", resp.StatusCode, string(body)) } // Extract the traits + log.Info().Msg("Extracting traits...") var schema map[string]any if err := json.Unmarshal(body, &schema); err != nil { return nil, err @@ -38,6 +40,7 @@ func ExtractReadOnlyTraits(url string) (map[string]bool, error) { return nil, errors.New("traits object missing from schema") } + log.Info().Msg(fmt.Sprintf("Traits: %+v", traits)) // Extract the readonly state for every trait traitStates := make(map[string]bool, len(traits)) for trait, rawValues := range traits {