mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Move "Molecula Consumer" message to the logger; hide it in basic mode
This commit is contained in:
parent
7a7bb0c928
commit
634553d3c3
3 changed files with 9 additions and 3 deletions
|
|
@ -384,6 +384,7 @@ func (cmd *Command) setupConfig() error {
|
|||
cmd.kafkaRunner = kafka.NewRunner(
|
||||
cleanCfg,
|
||||
batch.NewSQLBatcher(cmd, kafka.ConfigToFields(cfg)),
|
||||
cmd.Stderr,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package kafka
|
||||
|
||||
import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
fbbatch "github.com/featurebasedb/featurebase/v3/batch"
|
||||
"github.com/featurebasedb/featurebase/v3/errors"
|
||||
"github.com/featurebasedb/featurebase/v3/idk"
|
||||
"github.com/featurebasedb/featurebase/v3/idk/kafka_static"
|
||||
"github.com/featurebasedb/featurebase/v3/logger"
|
||||
)
|
||||
|
||||
type Runner struct {
|
||||
|
|
@ -18,7 +20,7 @@ type Runner struct {
|
|||
Header []idk.RawField `help:"Header configuration."`
|
||||
}
|
||||
|
||||
func NewRunner(cfg ConfigForIDK, batcher fbbatch.Batcher) *Runner {
|
||||
func NewRunner(cfg ConfigForIDK, batcher fbbatch.Batcher, logWriter io.Writer) *Runner {
|
||||
idkMain := idk.NewMain()
|
||||
idkMain.IDField = cfg.IDField
|
||||
idkMain.Index = cfg.Table
|
||||
|
|
@ -26,6 +28,7 @@ func NewRunner(cfg ConfigForIDK, batcher fbbatch.Batcher) *Runner {
|
|||
idkMain.BatchSize = cfg.BatchSize
|
||||
idkMain.BatchMaxStaleness = cfg.BatchMaxStaleness
|
||||
idkMain.Basic()
|
||||
idkMain.SetLog(logger.NewStandardLogger(logWriter))
|
||||
|
||||
kr := &Runner{
|
||||
Main: *idkMain,
|
||||
|
|
|
|||
|
|
@ -216,8 +216,6 @@ func (m *Main) Log() logger.Logger { return m.log }
|
|||
func (m *Main) SetLog(log logger.Logger) { m.log = log }
|
||||
|
||||
func NewMain() *Main {
|
||||
fmt.Fprintf(os.Stderr, "Molecula Consumer %s, build time %s\n", Version, BuildTime)
|
||||
|
||||
return &Main{
|
||||
PilosaHosts: []string{"localhost:10101"},
|
||||
PilosaGRPCHosts: []string{"localhost:20101"},
|
||||
|
|
@ -254,6 +252,10 @@ func (m *Main) Basic() {
|
|||
}
|
||||
|
||||
func (m *Main) Run() (err error) {
|
||||
if !m.basic {
|
||||
m.log.Printf("Molecula Consumer %s, build time %s\n", Version, BuildTime)
|
||||
}
|
||||
|
||||
onFinishRun, err := m.Setup()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "setting up")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue