From 020d32638e08726a0c10d29682f723364b3035ec Mon Sep 17 00:00:00 2001 From: favonia Date: Sun, 25 Jul 2021 19:52:33 -0500 Subject: [PATCH] fix(pp): fix comments and use less angry emojis for non-fatal errors. --- internal/config/config.go | 4 ++-- internal/pp/pp.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 23073e24..99bd9234 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -248,7 +248,7 @@ func (c *Config) checkUselessDomains(indent pp.Indent) { if !c.Policy[ipNet].IsManaged() { for domain := range domainSet[ipNet] { if !intersectSet[domain] { - pp.Printf(indent, pp.EmojiUserError, + pp.Printf(indent, pp.EmojiUserWarning, "Domain %v is ignored because it is only for %v but %v is unmanaged.", domain, ipNet, ipNet) } } @@ -266,7 +266,7 @@ func (c *Config) Normalize(indent pp.Indent) bool { for ipNet, domains := range c.Domains { if len(domains) == 0 && c.Policy[ipNet].IsManaged() { c.Policy[ipNet] = &detector.Unmanaged{} - pp.Printf(indent, pp.EmojiUserError, "IP%v_POLICY was changed to %q because no domains were set for %v.", + pp.Printf(indent, pp.EmojiUserWarning, "IP%v_POLICY was changed to %q because no domains were set for %v.", ipNet.Int(), c.Policy[ipNet], ipNet) } } diff --git a/internal/pp/pp.go b/internal/pp/pp.go index b42e07b5..007b07b6 100644 --- a/internal/pp/pp.go +++ b/internal/pp/pp.go @@ -39,7 +39,7 @@ const ( EmojiUserWarning Emoji = "😦" // warnings about possible configuration mistakes EmojiError Emoji = "😞" // errors that are not (directly) caused by user errors EmojiImpossible Emoji = "🤯" // the impossible happened - EmojiGood Emoji = "👍" // the impossible happened + EmojiGood Emoji = "👍" // everything looks good ) func (e Emoji) String() string {