Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding the tracing filter with the RUST_LOG environment variable #1895

Closed
5 tasks
romac opened this issue Feb 21, 2022 · 0 comments · Fixed by #1896
Closed
5 tasks

Allow overriding the tracing filter with the RUST_LOG environment variable #1895

romac opened this issue Feb 21, 2022 · 0 comments · Fixed by #1896
Assignees
Labels
I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@romac
Copy link
Member

romac commented Feb 21, 2022

Crate

ibc-relayer-cli

Summary

The current tracing filter is hardcoded and cannot be overridden, eg. to enable debug output for the tendermint-rpc crate as one would otherwise do with:

RUST_LOG=tendermint_rpc=debug hermes start

Problem Definition

For debugging purposes, we would like to enable tracing for dependencies of the relayer, eg. the tendermint-rpc crate, but this is not possible at the moment.

Proposal

Update the tracing filter builder to use the tracing filter specified via the RUST_LOG environment variable.

Acceptance Criteria

RUST_LOG=tendermint_rpc=debug hermes start

shows the debug output of the tendermint-rpc crate.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@romac romac added O: new-feature Objective: cause to add a new feature or support I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product labels Feb 21, 2022
@romac romac added this to the v0.12.0 milestone Feb 21, 2022
@romac romac self-assigned this Feb 21, 2022
@romac romac changed the title Allow overriding the tracing filter with the HERMES_LOG environment variable Allow overriding the tracing filter with the RUST_LOG environment variable Feb 21, 2022
romac added a commit that referenced this issue Feb 21, 2022
Closes: #1895

With this PR, one can set the `RUST_LOG` variable to `tendermint_rpc=debug,ibc_relayer=info,ibc_relayer_cli=info` in order to enable debug output for `tendermint-rpc` and info output for the relayer.

```shell
RUST_LOG=tendermint_rpc=debug,ibc_relayer=info,ibc_relayer_cli=info hermes start
```

---

* Allow overriding tracing filter with `RUST_LOG` env var

* Fix warning

* Add changelog entry

* Rename `log_level` to `default_level` as the parameter is ignored if `RUST_LOG` is set

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>

* Better log message

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>

* Small refactor

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>
@romac romac mentioned this issue Feb 21, 2022
6 tasks
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
…ems#1896)

Closes: informalsystems#1895

With this PR, one can set the `RUST_LOG` variable to `tendermint_rpc=debug,ibc_relayer=info,ibc_relayer_cli=info` in order to enable debug output for `tendermint-rpc` and info output for the relayer.

```shell
RUST_LOG=tendermint_rpc=debug,ibc_relayer=info,ibc_relayer_cli=info hermes start
```

---

* Allow overriding tracing filter with `RUST_LOG` env var

* Fix warning

* Add changelog entry

* Rename `log_level` to `default_level` as the parameter is ignored if `RUST_LOG` is set

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>

* Better log message

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>

* Small refactor

Co-authored-by: Mikhail Zabaluev <mikhail@informal.systems>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant