From 6c236628b17f310a88e4604ccc7507acd1fe95fd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 23 Oct 2024 06:27:56 -0500 Subject: [PATCH] cleanup STDOUT logging Signed-off-by: Jeff Carr --- addDroplet.go | 8 ++++---- main.go | 2 +- xml.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addDroplet.go b/addDroplet.go index f6baa8c..4266907 100644 --- a/addDroplet.go +++ b/addDroplet.go @@ -33,7 +33,7 @@ func addDomainDroplet(domcfg *libvirtxml.Domain) (*DropletT, error) { if me.changed { log.Info("updateDroplet() worked. droplet changed") } else { - log.Info("updateDroplet() worked. nothing changed") + log.Verbose("updateDroplet() worked. nothing changed") } } else { log.Info("updateDroplet() failed for", d.pb.Hostname) @@ -182,7 +182,7 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) bool { var found bool = false for i, eth := range d.pb.Networks { if eth.Mac == mac { - log.Info("OKAY. FOUND ETH:", i, eth.Mac, eth.Name) + log.Verbose("OKAY. FOUND ETH:", i, eth.Mac, eth.Name) found = true } } @@ -196,7 +196,7 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) bool { } } - log.Info("mac addrs:", macs) + log.Verbose("mac addrs:", macs) return true } @@ -217,7 +217,7 @@ func updateDisk(d *DropletT, domcfg *libvirtxml.Domain) bool { var found bool = false for _, disk := range d.pb.Disks { if disk.Filename == filename { - log.Info("OKAY. FOUND filename", filename) + log.Verbose("OKAY. FOUND filename", filename) found = true } } diff --git a/main.go b/main.go index 8f6d507..c942f27 100644 --- a/main.go +++ b/main.go @@ -73,7 +73,7 @@ func main() { if me.changed { log.Info("updateDroplet() worked. droplet changed") } else { - log.Info("updateDroplet() worked. nothing changed") + log.Info(filename, "nothing changed") } } else { log.Info("updateDroplet() failed for", d.pb.Hostname) diff --git a/xml.go b/xml.go index 08d9f51..86157d2 100644 --- a/xml.go +++ b/xml.go @@ -72,7 +72,7 @@ func addDefaults(d *libvirtxml.Domain, filename string) { } func readXml(filename string) (*libvirtxml.Domain, error) { - log.Info("parse xml file:", filename) + log.Verbose("parse xml file:", filename) pfile, err := os.ReadFile(filename) if err != nil { @@ -91,7 +91,7 @@ func readXml(filename string) (*libvirtxml.Domain, error) { } func (d *DropletT) mergeXml(filename string) error { - log.Info("parse xml file:", filename) + log.Info("merge xml file:", filename) pfile, err := os.ReadFile(filename) if err != nil {