-
Notifications
You must be signed in to change notification settings - Fork 31
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
Better indicate which log entries are repeated #22
Comments
I think something like this seems good, either as an option that can be enabled or as default behavior. I would probably use the language "OPENING", "ENTERING", "EXITING", and "CLOSING" rather than "STARTING", "CONTINUING", "PAUSING", and "ENDING", as that's more in line with the terminology used in the rest of |
The terminology was just a strawman; we are using this for stackframes in Miri. "ENTERING" and "EXITING" work fine there, though I assume the order would be "EXITING" and then "RE-ENTERING" or so? "OPENING" and "CLOSING" are a bit odd for stackframes but if that terminology works better for tracing-tree overall, I think we'll manage. |
@RalfJung "Exit" is the terminology used in I agree that "suspending" might have been more descriptive for the case where a context is exited but guaranteed to be re-entered, but it seems less accurate in the case where it is being exited and will then be closed permanently. Since we don't know which is taking place at the time where the exit is recorded, we chose the more general terminology. I think seeing a "SUSPENDING" in the logs immediately followed by a "STOPPING" or "CLOSING" wouldn't be too confusing, though. However, my two cents is that it's better to use the existing With that said, I'm open to being convinced otherwise — this isn't a strongly-held preference. And, this isn't my crate, so this is all just a suggestion. :) |
note that
means we are still in the |
This makes sense. However, keep in mind that this log will likely be read by people that didn't write the code that emits the trace, and thus they are not familiar with |
By default, I'd prefer to stick with // name subject to bike-shedding...
let naming = tracing_tree::SpanEvent::builder()
.on_span_creation("STARTING")
.on_span_entry("CONTINUING")
.on_span_exit("SUSPENDING")
.on_span_close("ENDING");
let layer = HierarchicalLayer::default()
.with_indent_lines(true)
.with_indent_amount(2)
.with_bracketed_fields(true)
.with_span_event_naming(naming)
.with_writer(std::io::stderr); What do y'all think? |
Sounds reasonable to me, assuming that we are not close to reaching too-many-options-syndrome. |
I worry about that as well, but I think we'll burn that bridge once we cross it. |
(I am not a direct user of this crate but involved via reviewing rust-lang/rust#75143, which will make Miri use this crate)
@oli-obk pointed me to this example of how the crate repeats log entries when subtrees start and end. However, I find it hard to tell which of these are new information vs. repeating old information to increase readability. I made a proposal but I am not sure if that's actually all that much better...
FWIW, Miri already does something like this kind of repetition, and translated back to tracing-tree that would look something like this:
In fact Miri also prints something like STARTING when the subtree starts, but I am less sure about that.
There are probably better ways to do this, but I find the current rendering hard to interpret.
The text was updated successfully, but these errors were encountered: