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-flamefeature ontest-log(this by itself doesn't to much other than adding the dependency).TEST_LOG_FLAMESenv-var to a path when running tests, will write traced out as{module}/{name}.folded.infernoas described bytracing-flamesThe result of this looks something like: