From 4c0d7868de28976a7d1a05f2aa3f7a2eeba1da06 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 14 Sep 2023 08:01:23 -0300 Subject: [PATCH] rewrite print statements to use log. --- utils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils.go b/utils.go index e4697ba..9824292 100644 --- a/utils.go +++ b/utils.go @@ -386,7 +386,7 @@ func trimProtocol(relay string) string { } func loadNpubsArchive(ctx context.Context) { - fmt.Println("Refreshing the npubs archive") + log.Debug().Msg("refreshing the npubs archive") contactsArchive := make([]string, 0, 500) @@ -399,13 +399,13 @@ func loadNpubsArchive(ctx context.Context) { contactsArchive = unique(contactsArchive) for _, contact := range contactsArchive { - fmt.Printf("Adding contact %s\n", contact) + log.Debug().Msgf("adding contact %s\n", contact) cache.SetWithTTL("pa:"+contact, nil, time.Hour*24*90) } } func loadRelaysArchive(ctx context.Context) { - fmt.Println("Refreshing the relays archive") + log.Debug().Msg("refreshing the relays archive") relaysArchive := make([]string, 0, 500) @@ -420,14 +420,14 @@ func loadRelaysArchive(ctx context.Context) { for _, relay := range relaysArchive { for _, excluded := range excludedRelays { if strings.Contains(relay, excluded) { - fmt.Printf("Skypping relay %s\n", relay) + log.Debug().Msgf("skipping relay %s\n", relay) continue } } if strings.Contains(relay, "/npub1") { - continue // Skip relays with personalyzed query like filter.nostr.wine + continue // skip relays with personalyzed query like filter.nostr.wine } - fmt.Printf("Adding relay %s\n", relay) + log.Debug().Msgf("adding relay %s\n", relay) cache.SetWithTTL("ra:"+relay, nil, time.Hour*24*7) } }