mcuadros / go-syslog

Syslog server library for go.
http://godoc.org/gopkg.in/mcuadros/go-syslog.v2
MIT License
523 stars 143 forks source link

It's not possible to implement custom Format since syslogparser was integrated #30

Closed cezarsa closed 8 years ago

cezarsa commented 8 years ago

Although there is a Format interface, the signature of GetParser is using an internal package:

type Format interface {
    GetParser([]byte) syslogparser.LogParser
    GetSplitFunc() bufio.SplitFunc
}

This way it's not possible to write a custom Format because it's impossible to import the internal package syslogparser.LogParser.

My suggestion is that GetParser should return Parser interface with methods Parse() and Dump().

I can work on a PR later if this change is something you're okay with.

mcuadros commented 8 years ago

Sure, go ahead, thanks.