tokio-rs / console-gsoc

Google Summer of Code tokio-console prototype
MIT License
12 stars 2 forks source link

Consider revisiting how fields are formatted #35

Open hawkw opened 5 years ago

hawkw commented 5 years ago

This is admittedly a bit of a minor nit, but I thought it was worth bringing up: currently, the console formats fields with the form <field name>(<field value>). This resembles the Rust syntax for function application. I think it might be better to change this to a format that looks more typical for a key-value pair.

Since fields are specified in the tracing macros as <field_name> = <field_value>, I think it might be good to format them with the same syntax as they are specified. This is what tracing-fmt's default formatters use. Alternatively, we could use <field_name>: <field_value>, similarly to struct initializer syntax.

We might also want to consider special-casing fields named message, since they are known to contain a textual, human-readable message.