The previous pipeline model required a lot of setup and abstracted away the processing of records. By passing a HandlerFunc to the consumer we keep the business logic of processing of records closer to the use of the consumer. * Add refactoring note and SHA to README
16 lines
354 B
Go
16 lines
354 B
Go
package connector
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/go-kit/kit/log"
|
|
)
|
|
|
|
// SetLogger adds the ability to change the logger so that external packages
|
|
// can control the logging for this package
|
|
func SetLogger(l log.Logger) {
|
|
logger = l
|
|
}
|
|
|
|
// specify a default logger so that we don't end up with panics.
|
|
var logger log.Logger = log.NewLogfmtLogger(os.Stderr)
|