1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Add debug printfs

This commit is contained in:
Tom Limoncelli
2023-11-12 18:10:13 -05:00
parent 0e8d24cfa0
commit 4f935be608
5 changed files with 34 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/StackExchange/dnscontrol/v4/models"
"github.com/StackExchange/dnscontrol/v4/pkg/prettyzone"
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
)
/*
@@ -103,7 +104,9 @@ func NewCompareConfig(origin string, existing, desired models.Records, compFn Co
labelMap: map[string]bool{},
keyMap: map[models.RecordKey]bool{},
}
printer.Printf("DEBUG: EXISTING:\n")
cc.addRecords(existing, true) // Must be called first so that CNAME manipulations happen in the correct order.
printer.Printf("DEBUG: DESIRED:\n")
cc.addRecords(desired, false)
cc.verifyCNAMEAssertions()
sort.Slice(cc.ldata, func(i, j int) bool {
@@ -215,6 +218,7 @@ func mkCompareBlobs(rc *models.RecordConfig, f func(*models.RecordConfig) string
}
}
// We do this to save memory. This assures the first return value uses the same memory as the second.
lenWithoutTTL := len(comp)
compFull := comp + fmt.Sprintf(" ttl=%d", rc.TTL)