Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
stdin : fix debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeantet committed Jun 4, 2017
1 parent a51a76d commit 31802c6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions processors/input-stdin/stdin.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func (p *processor) Start(e processors.IPacket) error {

stdinChan := make(chan string)
go func(p *processor, ch chan string) {
defer p.Logger.Errorln("XXXXXXXX")
for {
if record, err := dec.Decode(); err != nil {
p.Logger.Errorln("codec error : ", err.Error())
Expand All @@ -85,25 +84,21 @@ func (p *processor) Start(e processors.IPacket) error {
go func(ch chan string) {
for {
select {
case stdin, _ := <-ch:
case msg, _ := <-ch:

ne := p.NewPacket(stdin, map[string]interface{}{
ne := p.NewPacket(msg, map[string]interface{}{
"host": p.host,
})

processors.ProcessCommonFields(ne.Fields(), p.opt.Add_field, p.opt.Tags, p.opt.Type)
p.Send(ne)

case <-time.After(5 * time.Second):
case <-time.After(1 * time.Second):

}

select {
case <-p.q:
close(p.q)
close(ch)
return
default:
}
}
}(stdinChan)
Expand Down

0 comments on commit 31802c6

Please sign in to comment.