Skip to content
Snippets Groups Projects
Commit 3cf59b3d authored by ale's avatar ale
Browse files

Add flag to log lines that did not match anything

parent 9f32278b
No related branches found
No related tags found
No related merge requests found
Pipeline #28251 passed
package main package main
import ( import (
"flag"
"fmt" "fmt"
"log"
"regexp" "regexp"
"strconv" "strconv"
) )
var logUncaught = flag.Bool("log-uncaught", false, "dump log lines that did not match")
// A delivery is when a message is sent somewhere from within a // A delivery is when a message is sent somewhere from within a
// specific Flow. Deliveries are uniquely identified by their relay // specific Flow. Deliveries are uniquely identified by their relay
// attribute (recipients are aggregated by relay). We only keep track // attribute (recipients are aggregated by relay). We only keep track
...@@ -303,6 +307,8 @@ func (p *Parser) analyze(ts, host, program, message string) error { ...@@ -303,6 +307,8 @@ func (p *Parser) analyze(ts, host, program, message string) error {
} }
} }
//log.Printf("uncaught: %s %s %s", host, program, message) if *logUncaught {
log.Printf("uncaught: %s %s", program, message)
}
return nil return nil
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment