paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Document `--log` argument #8025

Open h4x3rotab opened 3 years ago

h4x3rotab commented 3 years ago

The format of the --log argument is unclear now. It only says:

Sets a custom logging filter. Syntax is \<target>=\<level>, e.g. -lsync=debug.

Log levels (least to most verbose) are error, warn, info, debug, and trace. By default, all targets log info. The global log level can be set with -l\<level>.

However the format can be very flexible. E.g. it supports setting log levels for multiple component: info,lsync=debug. Does it follow the env_logger's standard described here?

If so, I think it's necessary to make it explicitly described in the command line flag docs.

dvdplm commented 3 years ago

Does it follow the env_logger's standard described here?

Yes, it does. And I agree it would be good to mention the docs you link to. Do you mind opening a PR for that? :)

qdm12 commented 3 years ago

Related question, it mentions

https://github.com/paritytech/substrate/blob/0e0cdd84227bde26aa2825cc315e3c1317775a8d/client/cli/src/params/shared_params.rs#L48

Is there any documentation or variable defining all the possible targets? Thanks!!

bkchr commented 3 years ago

No there is no documentation on all the possible levels. I would also not recommend to copy this over to gossamer. Just come up with your own logging targets. In rust logging targets are for example the crate names if there is no explicit target given.