rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.11k stars 879 forks source link

Clean up output #266

Open vks opened 8 years ago

vks commented 8 years ago

Currently the output looks like this:

info: syncing channel updates for 'stable'
info: downloading component 'rust'
info: syncing channel updates for 'nightly'
info: downloading component 'rustc'
46.40 MiB / 46.40 MiB (100.00%) 4.57 MiB/s ETA: 0s                
info: downloading component 'rust-std'
58.85 MiB / 58.85 MiB (100.00%) 3.57 MiB/s ETA: 0s                
info: downloading component 'rust-docs'
6.25 MiB / 6.25 MiB (100.00%) 3.00 MiB/s ETA: 0s                
info: downloading component 'cargo'
4.06 MiB / 4.06 MiB (100.00%) 2.37 MiB/s ETA: 0s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'

The "info" is bold and quite redundant. It actually carries the least information, why is it highlighted? It would be much nicer to have something like cargo's output, i.e.:

    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading rust-gmp v0.2.10
 Downloading rustc-serialize v0.3.19
   Compiling rustc-serialize v0.3.19
   Compiling libc v0.2.9

Here the verbs are bold and carry the most important information.

brson commented 8 years ago

Thanks for the feedback. The info is bold because when that word is not info, but error or warning it is styled in bold color. Having all the log-line headers styled specially looks more consistent than just error/warning.

Part of future work is to make the cargo/rustup/rustfmt CLIs more consistent. I do like the way cargo emphasizes a verb, though there are other things about Cargo's UI i dislike.

The thing that bothers me more in your example is the download stats that interrupt the flow of the log.

vks commented 8 years ago

Shouldn't errors and warnings be rare? Why not optimize for the common case?

brson commented 8 years ago

Shouldn't errors and warnings be rare? Why not optimize for the common case?

They are rarer than non-errors for sure. You may be right that it would look bettor to not bold 'info:'. It's a point of preference. I took a look at the output without the bolding didn't have a strong opinion either way.

vks commented 8 years ago

It's a point of preference. I took a look at the output without the bolding didn't have a strong opinion either way.

Fair enough. I would probably remove the "info:" entirely and keep the "warning:" and "error:", but I guess this is just bikeshedding.

brson commented 8 years ago

It's tempting to remove the 'info' since it doesn't convey much. I like that the consistent label makes clear that this is a specific type of output, this is what rustup does when it's just working on stuff. Makes it distinct from other types of output in the CLI. Using Cargo's scheme might also accomplish the same thing, especially with colors. I'll definitely keep thinking about it.

pravic commented 8 years ago

Based on output from #708:

nightly-i686-pc-windows-msvc update failed written in red color, but error: component 'cargo' in white as other log entries. It would be nice to mark errors with red color too.

but error or warning it is styled in bold color.

As for me, it does not styles as bold (windows 7, conemu, Lucida Console).