0chain / gosdk

A client SDK in Go to interface the blockchain and storage platform, and other smart contracts
MIT License
32 stars 29 forks source link

Silent the zcnbridge logs when `--silent` is enabled #1206

Closed peterlimg closed 1 year ago

peterlimg commented 1 year ago

Currently the verbose logs is always true, which makes the zwalletcli and zboxcli that use the zcnbridge have outputs full of the verbose logs even we set the --silent falg. https://github.com/0chain/gosdk/blob/debug/mint-zcn/zcnbridge/http/rest.go#L44

` zwallet bridge-list-auth --silent zcnbridge-http-sdk [INFO] 2023/09/03 10:34:06.954223 rest.go:111: MakeSCRestAPICall waiting for response from all sharders zcnbridge-http-sdk [INFO] 2023/09/03 10:34:06.954294 rest.go:75: Query http://65.108.43.110:7171/v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0/getAuthorizerNodes?active=true zcnbridge-http-sdk [INFO] 2023/09/03 10:34:06.954406 rest.go:75: Query http://65.108.43.110:7172/v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0/getAuthorizerNodes?active=true 2023/09/03 10:34:06 [DEBUG] GET http://65.108.43.110:7171/v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0/getAuthorizerNodes?active=true 2023/09/03 10:34:06 [DEBUG] GET http://65.108.43.110:7172/v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0/getAuthorizerNodes?active=true zcnbridge-http-sdk [INFO] 2023/09/03 10:34:07.640449 rest.go:97: MakeSCRestAPICall successful query zcnbridge-http-sdk [INFO] 2023/09/03 10:34:07.640535 rest.go:105: MakeSCRestAPICall push body to results: {"nodes":[{"id":"1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802","url":"http://65.108.43.110:3031/"},{"id":"7f2097074f678d08146e5585d6965b04307939fee0457ea18c4242bff197c65a","url":"http://65.108.43.110:3033/"}]} zcnbridge-http-sdk [INFO] 2023/09/03 10:34:07.643300 rest.go:97: MakeSCRestAPICall successful query zcnbridge-http-sdk [INFO] 2023/09/03 10:34:07.643324 rest.go:105: MakeSCRestAPICall push body to results: {"nodes":[{"id":"1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802","url":"http://65.108.43.110:3031/"},{"id":"7f2097074f678d08146e5585d6965b04307939fee0457ea18c4242bff197c65a","url":"http://65.108.43.110:3033/"}]} zcnbridge-http-sdk [INFO] 2023/09/03 10:34:07.643336 rest.go:113: MakeSCRestAPICall closing results zcnbridge-http-sdk [DEBUG] 2023/09/03 10:34:07.643361 rest.go:117: request_sharders{received result 15 0 fbbdcc5ed56cca0e4f26d491aa0e15f46dbb7345 } {received body 15 0 {"nodes":[{"id":"1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802","url":"http://65.108.43.110:3031/"},{"id":"7f2097074f678d08146e5585d6965b04307939fee0457ea18c4242bff197c65a","url":"http://65.108.43.110:3033/"}]}

} [ { "id": "1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802", "url": "http://65.108.43.110:3031/" }, { "id": "7f2097074f678d08146e5585d6965b04307939fee0457ea18c4242bff197c65a", "url": "http://65.108.43.110:3033/" } ]`
boddumanohar commented 1 year ago

fixed by: https://github.com/0chain/gosdk/pull/1207