From 7e1a353b3b38adfe3cad72221ba66dd0fdac45f3 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Wed, 29 Jan 2025 12:53:23 -0600 Subject: [PATCH] download: remove printf verbs from span.AddEvent --- internal/download/download.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/download/download.go b/internal/download/download.go index 7792ba07..57c3a308 100644 --- a/internal/download/download.go +++ b/internal/download/download.go @@ -148,13 +148,12 @@ func loadOFACRecords(ctx context.Context, logger log.Logger, conf Config, respon if err != nil { return fmt.Errorf("parsing OFAC: %w", err) } - span.AddEvent(fmt.Sprintf("finished parsing after %v", time.Since(start))) + span.AddEvent("finished parsing") entities := ofac.GroupIntoEntities(res.SDNs, res.Addresses, res.SDNComments, res.AlternateIdentities) - msg := fmt.Sprintf("finished OFAC preperation: %v", time.Since(start)) - logger.Debug().Log(msg) - span.AddEvent(msg) + logger.Debug().Logf("finished OFAC preperation: %v", time.Since(start)) + span.AddEvent("finished OFAC preperation") if len(entities) == 0 && conf.ErrorOnEmptyList { return errors.New("no entities parsed from US OFAC") @@ -192,13 +191,12 @@ func loadCSLUSRecords(ctx context.Context, logger log.Logger, conf Config, respo if err != nil { return fmt.Errorf("parsing US CSL: %w", err) } - span.AddEvent(fmt.Sprintf("finished parsing after %v", time.Since(start))) + span.AddEvent("finished parsing") entities := csl_us.ConvertSanctionsData(res.SanctionsData) - msg := fmt.Sprintf("finished US CSL preperation: %v", time.Since(start)) - logger.Debug().Log(msg) - span.AddEvent(msg) + logger.Debug().Logf("finished US CSL preperation: %v", time.Since(start)) + span.AddEvent("finished US CSL preperation") if len(entities) == 0 && conf.ErrorOnEmptyList { return errors.New("no entities parsed from US CSL")