From 42bf566ffffceb505eb7acbf7391fd9f12dbe566 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 5 Aug 2021 18:18:18 +0100 Subject: [PATCH] Convert acls.go --- acls.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/acls.go b/acls.go index f4ed4c0e..fea72a7f 100644 --- a/acls.go +++ b/acls.go @@ -4,11 +4,12 @@ import ( "encoding/json" "fmt" "io" - "log" "os" "strconv" "strings" + "github.com/rs/zerolog/log" + "github.com/tailscale/hujson" "inet.af/netaddr" "tailscale.com/tailcfg" @@ -66,7 +67,8 @@ func (h *Headscale) generateACLRules() (*[]tailcfg.FilterRule, error) { for j, u := range a.Users { srcs, err := h.generateACLPolicySrcIP(u) if err != nil { - log.Printf("Error parsing ACL %d, User %d", i, j) + log.Error(). + Msgf("Error parsing ACL %d, User %d", i, j) return nil, err } srcIPs = append(srcIPs, *srcs...) @@ -77,7 +79,8 @@ func (h *Headscale) generateACLRules() (*[]tailcfg.FilterRule, error) { for j, d := range a.Ports { dests, err := h.generateACLPolicyDestPorts(d) if err != nil { - log.Printf("Error parsing ACL %d, Port %d", i, j) + log.Error(). + Msgf("Error parsing ACL %d, Port %d", i, j) return nil, err } destPorts = append(destPorts, *dests...)