ethresearch / sharding-p2p-poc

Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
40 stars 19 forks source link

Change CLI option loglevel to verbose #98

Closed NIC619 closed 5 years ago

NIC619 commented 5 years ago

How can it be fixed?

Make log output setting simpler.

-verbose will print all log, otherwise only Error and Fatal logs will be printed.

araskachoi commented 5 years ago

Should fix -loglevel= flag to throw if an invalid flag is inputted.

sharding-p2p-poc -client -rpcport=7788 addpeer 10.1.0.6 5566 1 -loglevel=VERBOSE

16:12:13.088 CRITI sharding-p: Client: usage: addpeer ip port seed cli.go:17

sharding-p2p-poc -client -rpcport=7788 addpeer 10.1.0.6 5566 1 -loglevel=ASDFG

16:12:23.108 CRITI sharding-p: Client: usage: addpeer ip port seed cli.go:17

These two give the same response.


Should probably give a response like: "invalid flag passed, please input a valid flag value."
and then give them the cli help command -loglevel string setting log level, e.g., DEBUG, WARNING, INFO, ERROR, CRITICAL (default "INFO")

NIC619 commented 5 years ago

Should fix -loglevel= flag to throw if an invalid flag is inputted.

Will do!

Though I was thinking about changing from -loglevel=XXX to -verbose so they don't have to worry about which log level to set - for ease of setting. What do you think about this? Or would you prefer a finer granularity of log level setting?

araskachoi commented 5 years ago

Yes! I think that would be alot nicer, I think there should be default responses (like a simple success/error) for rpc calls but full responses should be given when the user uses the --verbose flag. That way it is more simple and intuitive for people to use

araskachoi commented 5 years ago

but i think for testing purposes, the more the better so maybe we can have something like --verbosedev for more verbose outputs. However, I think for the production application, it would be best to have just --verbose

NIC619 commented 5 years ago

I think there should be default responses (like a simple success/error) for rpc calls

Currently we use return code to indicate if the client request succeeded (i.e., a failed request will trigger os.exit(1)). Is this approach handy to you or do you prefer printing out simple response?

NIC619 commented 5 years ago

Closed via #117