fix: parse log level

This commit is contained in:
Richard Ramos 2024-05-28 16:37:00 -04:00
parent 33b98bedb1
commit eeedcd38f2
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760
2 changed files with 8 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import (
"github.com/waku-org/storenode-messages/internal/logging"
"github.com/waku-org/storenode-messages/internal/persistence"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/protobuf/proto"
)
@ -92,8 +93,13 @@ func Execute(ctx context.Context, options Options) error {
return err
}
lvl, err := zapcore.ParseLevel(options.LogLevel)
if err != nil {
return err
}
wakuNode, err := node.New(
node.WithLogLevel(zap.DebugLevel), // options.LogLevel
node.WithLogLevel(lvl),
node.WithNTP(),
node.WithClusterID(uint16(options.ClusterID)),
node.WithHostAddress(hostAddr),

View File

@ -11,7 +11,7 @@ var options Options
func main() {
// Defaults
options.LogLevel = "INFO"
options.LogLevel = "DEBUG"
options.LogEncoding = "console"
app := &cli.App{