From d78d273d906c27eeb5296a1afbf170ccb68d6f77 Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Tue, 15 Jun 2021 19:22:17 -0700 Subject: [PATCH] cleanup debug logs --- irr.go | 2 +- main.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/irr.go b/irr.go index fc07c72a..5697564d 100644 --- a/irr.go +++ b/irr.go @@ -14,7 +14,7 @@ import ( func getIRRPrefixSet(asSet string, family uint8, irrServer string) ([]string, error) { // Run bgpq4 for BIRD format with aggregation enabled cmdArgs := fmt.Sprintf("-h %s -Ab%d %s", irrServer, family, asSet) - log.Printf("Running bgpq4 %s", cmdArgs) + log.Debugf("Running bgpq4 %s", cmdArgs) ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(10)) defer cancel() cmd := exec.CommandContext(ctx, "bgpq4", strings.Split(cmdArgs, " ")...) diff --git a/main.go b/main.go index 92db8eb0..2b42146b 100644 --- a/main.go +++ b/main.go @@ -34,7 +34,7 @@ func printStructInfo(label string, instance interface{}) { if !(contains(excludedFields, attrName)) { v := reflect.Indirect(s.Field(i)) if v.IsValid() { - log.Infof("[%s] field %s = %v\n", label, attrName, v) + log.Debugf("[%s] field %s = %v\n", label, attrName, v) } } } @@ -104,8 +104,7 @@ func run(args []string) { } // Enable debug logging in development releases - if //noinspection GoBoolExpressions - version == "devel" || cliFlags.Verbose { + if cliFlags.Verbose { log.SetLevel(log.DebugLevel) } @@ -190,6 +189,8 @@ func run(args []string) { // Iterate over peers for peerName, peerData := range globalConfig.Peers { + log.Printf("Processing AS%d %s", *peerData.ASN, peerName) + // Set sanitized peer name peerData.ProtocolName = sanitize(peerName)