Make loggers io.Writer implementations, not directly lumberjack objects

This commit is contained in:
Frank Denis 2020-07-08 11:36:58 +02:00
parent 7bec554709
commit 10710def50
5 changed files with 10 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
"io"
"net"
"strings"
"time"
@ -16,7 +17,7 @@ import (
type PluginBlockIP struct {
blockedPrefixes *iradix.Tree
blockedIPs map[string]interface{}
logger *lumberjack.Logger
logger io.Writer
format string
}

View File

@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
"io"
"net"
"strings"
"time"
@ -16,7 +17,7 @@ import (
type BlockedNames struct {
allWeeklyRanges *map[string]WeeklyRanges
patternMatcher *PatternMatcher
logger *lumberjack.Logger
logger io.Writer
format string
}

View File

@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
"io"
"net"
"time"
@ -12,7 +13,7 @@ import (
)
type PluginNxLog struct {
logger *lumberjack.Logger
logger io.Writer
format string
}

View File

@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
"io"
"net"
"strings"
"time"
@ -13,7 +14,7 @@ import (
)
type PluginQueryLog struct {
logger *lumberjack.Logger
logger io.Writer
format string
ignoredQtypes []string
}

View File

@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
"io"
"net"
"strings"
"time"
@ -16,7 +17,7 @@ import (
type PluginWhitelistName struct {
allWeeklyRanges *map[string]WeeklyRanges
patternMatcher *PatternMatcher
logger *lumberjack.Logger
logger io.Writer
format string
}