Skip to content

Commit 6b8f499

Browse files
committed
core/radix: m logs
1 parent b9cc1d9 commit 6b8f499

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

intra/backend/core_iptree_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ func Test192(tst *testing.T) {
6161

6262
func TestUn(tst *testing.T) {
6363
ll.SetLevel(ll.VVERBOSE)
64+
ll.SetCallerDepth(0)
6465
settings.Debug = true
6566

6667
trie := NewRadixTree()
67-
trie.Add("fritz.box") // exact domain
68-
trie.Add(".lan") // subdomain ending with .lan
69-
trie.Add(".sub.tld") // subdomain ending with .sub.tld
68+
trie.Add(".fritz.box") // exact domain
69+
trie.Add(".lan") // subdomain ending with .lan
70+
trie.Add(".sub.tld") // subdomain ending with .sub.tld
7071

71-
noma1 := trie.HasAny("test.fritz.box") // no subdomain matches
72+
noma1 := trie.HasAny("test.fritz.box") // subdomain matches
7273
yma1 := trie.HasAny("fritz.box") // exact match for fritz.box
7374
yma2 := trie.HasAny("test.lan") // subdomain match for .lan
7475
yma3 := trie.HasAny("mu.st.sub.tld") // subdomain match for sub.tld

intra/backend/core_radixtree.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,15 @@ func (c *radix) getMatch(str string) *string {
176176
// test: log.VV("radix: get: four: %s: %s [%d %d] %t", str, s, len(rev), len(match), ok)
177177
// partial match (ipvonly.arpa) but not a subdomain/wildcard, discard
178178
} else { // no match
179-
// log.V("radix: get: no prefix match for %s", str)
179+
if log.Verbose {
180+
log.V("radix: get: no prefix match for %s", str)
181+
}
180182
return nil
181183
}
182184

183-
log.V("radix: get: partial or full %s => %s; rev %s; match %s; ok? %t", str, s, rev, match, ok)
185+
if log.Verbose {
186+
log.V("radix: get: partial or full %s => %s; rev %s; match %s; ok? %t", str, s, rev, match, ok)
187+
}
184188

185189
if !ok {
186190
return nil

0 commit comments

Comments
 (0)