oscope-dev / scope

Scoping user machines
https://oscope-dev.github.io/scope/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Consider removing timestamp and log level from display #26

Closed technicalpickles closed 6 months ago

technicalpickles commented 9 months ago

Consider:

❯ scope doctor list                                                                                                                                                                       ─╯
10:47:58  INFO More detailed logs at /tmp/scope/scope-root-20240123-w31p.log
10:47:58  INFO Available checks that will run
10:47:58  INFO         Name                      Description
10:47:58  INFO   rbenv-configured         Check your shell for rbenv

Having a timestamp for this is kinda distracting and doesn't offer much in this case. Most of the time when I see the timestamp & INFO in output, it's not adding much so maybe worth turning off by default? other log levels could be useful to display though

technicalpickles commented 9 months ago

I think it's defined down here: https://github.com/ethankhall/scope/blob/032af1454393bbfad41590c07441508a9a2df1e3/scope-lib/src/logging.rs#L78-L93

I haven't been able to make sense of it to change how it looks though 🤔

technicalpickles commented 9 months ago

Seems like it's easy to remove the timestamps with without_time:

        let console_output = tracing_subscriber::fmt::layer()
            .event_format(Format::default().with_target(false).without_time().compact())
            .with_timer(output_fmt)
            .fmt_fields(PrettyFields::new());

It's also possible to completely completely remove the level with without_level. What I'm not seeing, though, is conditionally displaying the level if it's not a INFO.

ethankhall commented 6 months ago

This is done w/ the latest changes.