Skip to content

Commit

Permalink
cleanup devnull
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Jun 13, 2024
1 parent f9726bf commit 67f53a6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 4 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ pipelines:
normalize:
qname-lowercase: true
routing-policy:
forward: [ console ]
forward: [ hole ]
dropped: [ ]

- name: console
stdout:
mode: text

- name: hole
devnull: {}

################################################
# DEPRECATED - multiplexer configuration
# more details: https://github.com/dmachard/go-dnscollector/blob/main/docs/running_mode.md#multiplexer
Expand Down
8 changes: 8 additions & 0 deletions docs/loggers/logger_devnull.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ Default values:
devnull:
chan-buffer-size: 0
```
Example
```yaml
pipelines:
- name: hole
devnull: {}
```
5 changes: 2 additions & 3 deletions pkgconfig/loggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (

type ConfigLoggers struct {
DevNull struct {
Enable bool `yaml:"enable" default:"false"`
Mode string `yaml:"mode" default:"text"`
ChannelBufferSize int `yaml:"chan-buffer-size" default:"0"`
Enable bool `yaml:"enable" default:"false"`
ChannelBufferSize int `yaml:"chan-buffer-size" default:"0"`
} `yaml:"devnull"`
Stdout struct {
Enable bool `yaml:"enable" default:"false"`
Expand Down
5 changes: 1 addition & 4 deletions workers/devnull.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ func (w *DevNull) StartCollect() {
w.LogInfo("starting data collection")
defer w.CollectDone()

// goroutine to process transformed dns messages
go w.StartLogging()

// loop to process incoming messages
for {
select {
case <-w.OnStop():
w.StopLogger()
return

case _, opened := <-w.GetInputChannel():
if !opened {
Expand Down

0 comments on commit 67f53a6

Please sign in to comment.