Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kiootic committed Jun 27, 2023
1 parent 35b72f1 commit fc824bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/pageship/app/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var appsCreateCmd = &cobra.Command{
if code, ok := api.ErrorStatusCode(err); ok && code == http.StatusNotFound {
app = nil
} else if err != nil {
return fmt.Errorf("fFailed to get app: %w", err)
return fmt.Errorf("failed to get app: %w", err)
}

if app != nil {
Expand Down
6 changes: 5 additions & 1 deletion internal/handler/controller/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func (c *Controller) handleSiteCreate(w http.ResponseWriter, r *http.Request) {
return nil, err
}

log(r).Info("creating site", zap.String("site", site.ID))
log(r).Info("creating site",
zap.String("site", info.ID),
zap.String("name", info.Name))

return c.makeAPISite(app, *info), nil
}))
Expand Down Expand Up @@ -206,6 +208,8 @@ func (c *Controller) handleSiteUpdate(w http.ResponseWriter, r *http.Request) {
oldDeployment = *site.DeploymentID
}
log(r).Info("updating site deployment",
zap.String("site", site.ID),
zap.String("site_name", site.Name),
zap.String("old_deployment", oldDeployment),
zap.String("new_deployment", *request.DeploymentName),
)
Expand Down

0 comments on commit fc824bb

Please sign in to comment.