From a9d951fc97e34f4b58e5f672282bc52b7c62dacc Mon Sep 17 00:00:00 2001 From: Cybwan Date: Fri, 20 Oct 2023 13:53:52 +0800 Subject: [PATCH] fix log level. --- api/loxinlp/nlp.go | 12 ++++++------ loxinet/dpebpf_linux.go | 5 +++-- loxinet/rules.go | 12 +++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/api/loxinlp/nlp.go b/api/loxinlp/nlp.go index 29cc53c0d..a0c734924 100644 --- a/api/loxinlp/nlp.go +++ b/api/loxinlp/nlp.go @@ -996,7 +996,7 @@ func AddNeigh(neigh nlp.Neigh, link nlp.Link) int { brId = vxlan.VxlanId ftype = cmn.FdbTun } else { - tk.LogIt(tk.LogError, "[NLP] L2fdb %v brId %v dst %v dev %v IGNORED\n", mac[:], brId, dst, name) + tk.LogIt(tk.LogInfo, "[NLP] L2fdb %v brId %v dst %v dev %v IGNORED\n", mac[:], brId, dst, name) return 0 } } else { @@ -1037,7 +1037,7 @@ func DelNeigh(neigh nlp.Neigh, link nlp.Link) int { tk.LogIt(tk.LogError, "[NLP] NH %v %v del failed\n", neigh.IP.String(), name) ret = -1 } else { - tk.LogIt(tk.LogError, "[NLP] NH %v %v deleted\n", neigh.IP.String(), name) + tk.LogIt(tk.LogInfo, "[NLP] NH %v %v deleted\n", neigh.IP.String(), name) } } else { @@ -1121,10 +1121,10 @@ func AddRoute(route nlp.Route) int { } } else { if route.Gw != nil { - tk.LogIt(tk.LogError, "[NLP] RT %s via %s added\n", ipNet.String(), + tk.LogIt(tk.LogInfo, "[NLP] RT %s via %s added\n", ipNet.String(), route.Gw.String()) } else { - tk.LogIt(tk.LogError, "[NLP] RT %s added\n", ipNet.String()) + tk.LogIt(tk.LogInfo, "[NLP] RT %s added\n", ipNet.String()) } } @@ -1184,10 +1184,10 @@ func DelRoute(route nlp.Route) int { } } else { if route.Gw != nil { - tk.LogIt(tk.LogError, "[NLP] RT %s via %s deleted\n", ipNet.String(), + tk.LogIt(tk.LogInfo, "[NLP] RT %s via %s deleted\n", ipNet.String(), route.Gw.String()) } else { - tk.LogIt(tk.LogError, "[NLP] RT %s deleted\n", ipNet.String()) + tk.LogIt(tk.LogInfo, "[NLP] RT %s deleted\n", ipNet.String()) } } return ret diff --git a/loxinet/dpebpf_linux.go b/loxinet/dpebpf_linux.go index 7ec749e32..38d0ae2ca 100644 --- a/loxinet/dpebpf_linux.go +++ b/loxinet/dpebpf_linux.go @@ -52,9 +52,10 @@ import ( "time" "unsafe" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" nlp "github.com/vishvananda/netlink" + + cmn "github.com/loxilb-io/loxilb/common" ) // This file implements the interface DpHookInterface @@ -1985,7 +1986,7 @@ func (e *DpEbpfH) DpCtDel(w *DpCtInfo) int { mapKey := w.Key() cti := mh.dpEbpf.ctMap[mapKey] if cti == nil { - tk.LogIt(tk.LogError, "ctInfo-key (%v) not present\n", mapKey) + tk.LogIt(tk.LogDebug, "ctInfo-key (%v) not present\n", mapKey) return 0 } diff --git a/loxinet/rules.go b/loxinet/rules.go index 0d6d01dda..1ae88db5d 100644 --- a/loxinet/rules.go +++ b/loxinet/rules.go @@ -23,10 +23,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/loxilb-io/loxilb/api/loxinlp" - cmn "github.com/loxilb-io/loxilb/common" - tk "github.com/loxilb-io/loxilib" - probing "github.com/prometheus-community/pro-bing" "io/ioutil" "net" "reflect" @@ -34,6 +30,12 @@ import ( "strconv" "sync" "time" + + tk "github.com/loxilb-io/loxilib" + probing "github.com/prometheus-community/pro-bing" + + "github.com/loxilb-io/loxilb/api/loxinlp" + cmn "github.com/loxilb-io/loxilb/common" ) // error codes @@ -357,7 +359,7 @@ func RulesInit(zone *Zone) *RuleH { tk.LogIt(tk.LogError, "RootCA cert load failed : %v\n", err) } else { nRh.rootCAPool.AppendCertsFromPEM(rootCA) - tk.LogIt(tk.LogError, "RootCA cert loaded\n") + tk.LogIt(tk.LogDebug, "RootCA cert loaded\n") } }