|
@@ -17,7 +17,7 @@ type Output struct {
|
|
|
}
|
|
|
|
|
|
// Parse needs a reader of the log, and will produce parsed output
|
|
|
-func Parse(r io.Reader, parsed chan<- Output) {
|
|
|
+func Parse(r io.Reader, parsed chan<- Output, onexit chan interface{}) {
|
|
|
scanner := bufio.NewScanner(r)
|
|
|
for scanner.Scan() {
|
|
|
out, err := outParseLine(scanner.Text())
|
|
@@ -25,6 +25,7 @@ func Parse(r io.Reader, parsed chan<- Output) {
|
|
|
parsed <- out
|
|
|
}
|
|
|
}
|
|
|
+ onexit <- struct{}{}
|
|
|
}
|
|
|
|
|
|
var lineRegex = regexp.MustCompile(`^([0-9]{4}/[0-9]{2}/[0-9]{2}) ([0-9:]{8}) \[([^:\[\]]*):([0-9])\] (.*)$`)
|