Skip to content

Commit

Permalink
fix regression in stdout #8
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Nov 9, 2021
1 parent a7ab91c commit b3c2513
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions loggers/stdout.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
type StdOut struct {
done chan bool
channel chan dnsutils.DnsMessage
mode string
textFormat []string
config *dnsutils.Config
logger *logger.Logger
Expand Down Expand Up @@ -76,7 +75,7 @@ func (o *StdOut) Run() {

buffer := new(bytes.Buffer)
for dm := range o.channel {
switch o.mode {
switch o.config.Loggers.Stdout.Mode {
case "text":
o.stdout.Print(dm.String(o.textFormat))
case "json":
Expand Down
3 changes: 2 additions & 1 deletion loggers/syslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"github.com/dmachard/go-logger"
)

func TestSyslogRun(t *testing.T) {
func TestSyslogRunTextMode(t *testing.T) {
// init logger
config := dnsutils.GetFakeConfig()
config.Loggers.Syslog.Transport = "tcp"
config.Loggers.Syslog.RemoteAddress = ":4000"
config.Loggers.Syslog.Mode = "text"
g := NewSyslog(config, logger.New(false))

// fake json receiver
Expand Down

0 comments on commit b3c2513

Please sign in to comment.