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

Parametrize tracing formatter #434

Open
adizere opened this issue Jan 11, 2021 · 2 comments
Open

Parametrize tracing formatter #434

adizere opened this issue Jan 11, 2021 · 2 comments

Comments

@adizere
Copy link
Contributor

adizere commented Jan 11, 2021

Summary

For our use-case in the relayer-cli crate (informalsystems/hermes#500) we would like to enable JSON-formatted tracing output. At first glance, it's not clear if abscissa permits this kind of configuration. Thanks in advance for any advice!

Description

Abscissa core is setting the global subscriber for tracing as follows:

tracing::subscriber::set_global_default(subscriber)

If I understand correctly, all applications built on abscissa are forced to use this subscriber. It would be great to allow more flexibility here. Note that documentation in tracing seems to provide guidance specifically against libraries using set_global_default.

@tony-iqlusion
Copy link
Member

Yes, this would definitely be good.

For reference, how zebrad is managing its tracing config:

https://github.com/ZcashFoundation/zebra/blob/main/zebrad/src/application.rs#L220-L238

@adizere
Copy link
Contributor Author

adizere commented Jan 14, 2021

Thanks!

Just to note that this issue it not a priority.

We decided to use a custom solution instead of globally enabling JSON output. In the future, we may switch to a more principled approach, similar to the suggested zebrad solution to make all tracing output in JSON (minimal working example here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants