2021-04-04 17:06:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2022-11-02 10:39:13 +00:00
|
|
|
logging "github.com/ipfs/go-log/v2"
|
2022-08-15 18:29:59 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2022-11-09 19:53:01 +00:00
|
|
|
"github.com/waku-org/go-waku/waku/v2/utils"
|
2024-08-19 09:30:15 +00:00
|
|
|
"go.uber.org/zap/zapcore"
|
2021-04-04 17:06:17 +00:00
|
|
|
)
|
|
|
|
|
2022-08-15 18:29:59 +00:00
|
|
|
var options Options
|
2021-04-06 23:27:54 +00:00
|
|
|
|
2021-04-04 17:06:17 +00:00
|
|
|
func main() {
|
2022-08-15 18:29:59 +00:00
|
|
|
app := &cli.App{
|
|
|
|
Flags: getFlags(),
|
|
|
|
Action: func(c *cli.Context) error {
|
2024-08-19 09:30:15 +00:00
|
|
|
lvl, err := zapcore.ParseLevel(options.LogLevel)
|
2021-09-30 23:03:19 +00:00
|
|
|
if err != nil {
|
2022-08-15 18:29:59 +00:00
|
|
|
return err
|
2021-09-30 23:03:19 +00:00
|
|
|
}
|
2024-08-19 09:30:15 +00:00
|
|
|
|
|
|
|
logging.SetAllLoggers(logging.LogLevel(lvl))
|
|
|
|
utils.InitLogger("console", "file:chat2.log", "chat2", lvl)
|
2021-06-28 14:14:28 +00:00
|
|
|
|
2022-08-15 18:29:59 +00:00
|
|
|
execute(options)
|
|
|
|
return nil
|
|
|
|
},
|
2021-04-04 17:06:17 +00:00
|
|
|
}
|
|
|
|
|
2022-08-15 18:29:59 +00:00
|
|
|
err := app.Run(os.Args)
|
2021-04-04 17:06:17 +00:00
|
|
|
if err != nil {
|
2022-02-21 17:46:58 +00:00
|
|
|
panic(err)
|
2021-04-04 17:06:17 +00:00
|
|
|
}
|
2021-09-30 16:02:04 +00:00
|
|
|
}
|