Skip to content

Commit

Permalink
add more debugging log
Browse files Browse the repository at this point in the history
  • Loading branch information
kokizzu committed Feb 28, 2024
1 parent a516f22 commit de55903
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ func CreateWebServer(p *gcoreprovider.DnsProvider) *webServer {
}
requestLog(r).Debugf("requesting apply changes, create: %d , updateOld: %d, updateNew: %d, delete: %d",
len(changes.Create), len(changes.UpdateOld), len(changes.UpdateNew), len(changes.Delete))
if len(changes.Create) > 0 {
requestLog(r).Debug("detail for create: ", changes.Create)
}
if len(changes.UpdateOld) > 0 {
requestLog(r).Debug("detail for updateOld: ", changes.UpdateOld)
}
if len(changes.UpdateNew) > 0 {
requestLog(r).Debug("detail for updateNew: ", changes.UpdateNew)
}
if len(changes.Delete) > 0 {
requestLog(r).Debug("detail for delete: ", changes.Delete)
}
if err := p.ApplyChanges(ctx, &changes); err != nil {
w.Header().Set(contentTypeHeader, contentTypePlaintext)
w.WriteHeader(http.StatusInternalServerError)
Expand Down Expand Up @@ -179,7 +191,7 @@ func CreateWebServer(p *gcoreprovider.DnsProvider) *webServer {
log.Debugf("requesting adjust endpoints count: %d", len(pve))
pve, _ = p.AdjustEndpoints(pve)
out, _ := json.Marshal(&pve)
log.Debugf("return adjust endpoints response, resultEndpointCount: %d", len(pve))
log.Debugf("return adjust endpoints response, resultEndpointCount: %d: %s", len(pve), string(out))
w.Header().Set(contentTypeHeader, string(mediaTypeVersion1))
w.Header().Set(varyHeader, contentTypeHeader)
if _, writeError := fmt.Fprint(w, string(out)); writeError != nil {
Expand Down

0 comments on commit de55903

Please sign in to comment.