Revert "fix pubsub config flag"

This reverts commit 590f7ab83c.

590f7ab83c (r52422601)
pull/27/head
edouard 3 years ago
parent d3afc3223e
commit ca190b3822

@ -24,12 +24,6 @@ func New() *cli.App {
Usage: "print the version", Usage: "print the version",
} }
configFlag := cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "path to config file",
}
return &cli.App{ return &cli.App{
Name: "lntop", Name: "lntop",
Version: version, Version: version,
@ -37,7 +31,11 @@ func New() *cli.App {
EnableShellCompletion: true, EnableShellCompletion: true,
Action: run, Action: run,
Flags: []cli.Flag{ Flags: []cli.Flag{
&configFlag, &cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "path to config file",
},
}, },
Commands: []*cli.Command{ Commands: []*cli.Command{
{ {
@ -45,9 +43,6 @@ func New() *cli.App {
Aliases: []string{""}, Aliases: []string{""},
Usage: "run the pubsub only", Usage: "run the pubsub only",
Action: pubsubRun, Action: pubsubRun,
Flags: []cli.Flag{
&configFlag,
},
}, },
}, },
} }

@ -56,13 +56,13 @@ func New(cfg config.Logger) (Logger, error) {
func NewProductionLogger(dest string) (Logger, error) { func NewProductionLogger(dest string) (Logger, error) {
config := zap.NewProductionConfig() config := zap.NewProductionConfig()
config.OutputPaths = []string{"stderr", dest} config.OutputPaths = []string{dest}
return config.Build() return config.Build()
} }
func NewDevelopmentLogger(dest string) (Logger, error) { func NewDevelopmentLogger(dest string) (Logger, error) {
config := zap.NewDevelopmentConfig() config := zap.NewDevelopmentConfig()
config.OutputPaths = []string{"stderr", dest} config.OutputPaths = []string{dest}
return config.Build() return config.Build()
} }

@ -33,7 +33,7 @@ func (p *PubSub) invoices(ctx context.Context, sub chan *events.Event) {
go func() { go func() {
for invoice := range invoices { for invoice := range invoices {
p.logger.Info("receive invoice", logging.Object("invoice", invoice)) p.logger.Debug("receive invoice", logging.Object("invoice", invoice))
if invoice.Settled { if invoice.Settled {
sub <- events.New(events.InvoiceSettled) sub <- events.New(events.InvoiceSettled)
} else { } else {
@ -66,7 +66,7 @@ func (p *PubSub) transactions(ctx context.Context, sub chan *events.Event) {
go func() { go func() {
for tx := range transactions { for tx := range transactions {
p.logger.Info("receive transaction", logging.String("tx_hash", tx.TxHash)) p.logger.Debug("receive transaction", logging.String("tx_hash", tx.TxHash))
sub <- events.New(events.TransactionCreated) sub <- events.New(events.TransactionCreated)
} }
p.wg.Done() p.wg.Done()
@ -95,7 +95,7 @@ func (p *PubSub) routingUpdates(ctx context.Context, sub chan *events.Event) {
go func() { go func() {
for hu := range routingUpdates { for hu := range routingUpdates {
p.logger.Info("receive htlcUpdate") p.logger.Debug("receive htlcUpdate")
sub <- events.NewWithData(events.RoutingEventUpdated, hu) sub <- events.NewWithData(events.RoutingEventUpdated, hu)
} }
p.wg.Done() p.wg.Done()

Loading…
Cancel
Save