fix: log output and encoding (#656)

This commit is contained in:
richΛrd 2023-08-18 23:18:42 -04:00 committed by GitHub
parent 2818c3d394
commit ee17c23345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ const dialTimeout = 7 * time.Second
// Execute starts a go-waku node with settings determined by the Options parameter // Execute starts a go-waku node with settings determined by the Options parameter
func Execute(options NodeOptions) { func Execute(options NodeOptions) {
// Set encoding for logs (console, json, ...)
// Note that libp2p reads the encoding from GOLOG_LOG_FMT env var.
utils.InitLogger(options.LogEncoding, options.LogOutput)
hostAddr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%d", options.Address, options.Port)) hostAddr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%d", options.Address, options.Port))
failOnErr(err, "invalid host address") failOnErr(err, "invalid host address")