2
0
mirror of https://github.com/edouardparis/lntop synced 2024-11-08 01:10:32 +00:00

fix pubsub config flag

This commit is contained in:
edouard 2021-06-19 16:28:11 +02:00
parent 17f04a6924
commit 590f7ab83c
3 changed files with 15 additions and 10 deletions

View File

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

View File

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

View File

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