-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add support for tracing-flame #49
base: main
Are you sure you want to change the base?
Conversation
In my opinion this functionality doesn't belong in this crate, or it will become a dumping ground for all sorts of initialization logic. I suggest you create a new crate. |
Fair. What about adding some kind of "initializer" where someone could provide some |
Conceptually, yes, that may be okay. That being said, I don't believe that's possible at this point. Perhaps once global attribute support is available on stable Rust that could be made to work, but until then I am not sure how you'd set global state before Do you have a way to go about it? |
Without having any concrete idea, I was hoping that I could get the following to work (syntax might vary): #[test_log::test(init=init_fn)]
fn test() {} |
Right, but if |
I put this into draft state. I doesn't have a high priority for me. I'll see if I can come up with something reasonable, but don't want to make any promises. |
This PR is based on #48. Only the last commit belongs to this PR.
This adds support for tracing-flame. (See #47)
This PR works, but might need some work on the documentation. I am happy to follow up with it if you think the approach is good in general.
Here is how this works:
tracing-flame
feature ontest-log
(this by itself doesn't to much other than adding the dependency).TEST_LOG_FLAMES
env-var to a path when running tests, will write traced out as{module}/{name}.folded
.inferno
as described bytracing-flames
The result of this looks something like: