41 lines
653 B
Go
Raw Normal View History

2021-04-04 13:06:17 -04:00
package main
import (
"os"
logging "github.com/ipfs/go-log"
"github.com/status-im/go-waku/waku/v2/utils"
2022-08-15 14:29:59 -04:00
"github.com/urfave/cli/v2"
2021-04-04 13:06:17 -04:00
)
2022-08-15 14:29:59 -04:00
var options Options
2021-04-04 13:06:17 -04:00
func main() {
2022-08-15 14:29:59 -04:00
app := &cli.App{
Flags: getFlags(),
Action: func(c *cli.Context) error {
// for go-libp2p loggers
logLevel := "panic" // to mute output from logs
lvl, err := logging.LevelFromString(logLevel)
2022-08-08 20:02:08 -04:00
if err != nil {
2022-08-15 14:29:59 -04:00
return err
2022-08-04 17:39:12 -04:00
}
2022-08-15 14:29:59 -04:00
logging.SetAllLoggers(lvl)
2022-08-04 17:39:12 -04:00
2022-08-15 14:29:59 -04:00
// go-waku logger
err = utils.SetLogLevel(logLevel)
if err != nil {
2022-08-15 14:29:59 -04:00
return err
}
2021-06-28 10:14:28 -04:00
2022-08-15 14:29:59 -04:00
execute(options)
return nil
},
2021-04-04 13:06:17 -04:00
}
2022-08-15 14:29:59 -04:00
err := app.Run(os.Args)
2021-04-04 13:06:17 -04:00
if err != nil {
panic(err)
2021-04-04 13:06:17 -04:00
}
2021-09-30 12:02:04 -04:00
}