feat: add debug log level

This commit is contained in:
Stavros
2025-01-26 20:23:09 +02:00
parent 94f7debb10
commit 08d382c981
10 changed files with 119 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ import (
"encoding/json"
"io"
"net/http"
"github.com/rs/zerolog/log"
)
type GoogleUserInfoResponse struct {
@@ -21,12 +23,16 @@ func GetGoogleEmail(client *http.Client) (string, error) {
return "", resErr
}
log.Debug().Msg("Got response from google")
body, bodyErr := io.ReadAll(res.Body)
if bodyErr != nil {
return "", bodyErr
}
log.Debug().Msg("Read body from google")
var user GoogleUserInfoResponse
jsonErr := json.Unmarshal(body, &user)
@@ -35,5 +41,7 @@ func GetGoogleEmail(client *http.Client) (string, error) {
return "", jsonErr
}
log.Debug().Interface("user", user).Msg("Parsed user from google")
return user.Email, nil
}