nearcore icon indicating copy to clipboard operation
nearcore copied to clipboard

Remove --verbose in favor of RUST_LOG

Open mfornet opened this issue 4 years ago • 7 comments

By default Near binary only display logs that are info, warn and error, and it is possible to show debug logs for a specific target using -~~verbose <target_name> (~~-verbose chain).

After #2480 RUST_LOG can be used to control which logs are shown, multiple directive can be specified at the same time. For example:

export RUST_LOG=network=trace,chain=info

  • [ ] Remove --verbose argument as it is not a boolean argument, and for non technical users it is not really clear how to use it.
  • [ ] Add some help about how to use RUST_LOG for near (for developer, and for validators). The idea here is to enumerate all our targets, and whenever relevant explain what do we expect to see from that <target>=<level>. (For example: use network=debug to see all the traffic).
  • [x] Pass RUST_LOG to docker on nearup https://github.com/near/nearup/pull/32

mfornet avatar Apr 16 '20 16:04 mfornet

This is a bit overlapping with #4347, I can remove it with my changes or do it after? Might be conflicts if someone takes this now

austinabell avatar Jun 08 '21 17:06 austinabell

I can do this (on top of #4356) if someone shares info on where exactly you would like me to document how to use RUST_LOG. Also if this, any info about what points to be included would be helpful as there are a decent amount of targets and I'm not great at wording these things :)

austinabell avatar Jun 08 '21 21:06 austinabell

Once rolling this, we will need to update nearup first to use the same RUST_LOG env var, as it depends still on this flag to pass custom logging parameters.

chefsale avatar Jun 16 '21 15:06 chefsale

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 04 '21 22:10 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 03 '22 15:01 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '22 16:04 stale[bot]

Once rolling this, we will need to update nearup first to use the same RUST_LOG env var, as it depends still on this flag to pass custom logging parameters.

FYI, nearup does use RUST_LOG and does not pass --verbose to neard so from nearup’s point of view removing neard’s --verbose might just as well not exist.

One thing to remember with this change is to introduce a grace period of at least a release or two when --verbose works but prints a warning.

mina86 avatar Apr 10 '22 17:04 mina86

https://github.com/near/nearcore/pull/9547

nikurt avatar Sep 21 '23 08:09 nikurt