Skip to content

Commit a273013

Browse files
committed
Log filters.
1 parent 9b37bbc commit a273013

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sel/sel.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package sel
33
import (
44
"slices"
55
"strings"
6+
7+
"github.com/percona/percona-clustersync-mongodb/log"
68
)
79

810
// NSFilter returns true if a namespace is allowed.
@@ -13,13 +15,18 @@ func AllowAllFilter(string, string) bool {
1315
}
1416

1517
func MakeFilter(include, exclude []string) NSFilter {
18+
lg := log.New("filter")
19+
1620
if len(include) == 0 && len(exclude) == 0 {
1721
return AllowAllFilter
1822
}
1923

2024
includeFilter := doMakeFitler(include)
2125
excludeFilter := doMakeFitler(exclude)
2226

27+
lg.Infof("Include filter: %v", strings.Join(include, ", "))
28+
lg.Infof("Exclude filter: %v", strings.Join(exclude, ", "))
29+
2330
return func(db, coll string) bool {
2431
_, dbIncluded := includeFilter[db]
2532

0 commit comments

Comments
 (0)