davidbarsky / tracing-tree

Apache License 2.0
123 stars 31 forks source link

Put fields on their own lines #62

Open oli-obk opened 1 year ago

oli-obk commented 1 year ago

I'm opening this to discuss how it looks and whether we want something like this.

I'd prefer not to make it configurable, but just turn it on by default.

I'll clean up the code after we have a rendering that everyone is happy with, as currently the code has lots of magic numbers and of copy paste.

terminal example:

image

davidbarsky commented 1 year ago

It took me a second to adjust to what's happening here, but... yeah, I think we should go for it. I assume this is more useful for rustc?

I'd prefer not to make it configurable, but just turn it on by default.

That's certainly fair, but I think we'll need to make this a breaking change because it feels meaningfully different from the previous format. That okay?

On an aside, I wonder if it would make sense (or even, if it would be possible!) to make the field formatter implement FormatFields, but that's not a blocker at the moment and can be added if/when people complain or ask for a toggle. At the very least, it'd avoid needing wrapping a bunch of magic numbers in conditionals, branching more than it already does.

oli-obk commented 1 year ago

There is some concern about the verbosity of this, so I'm going to create some rustc examples and will check what rustc folk think