buildfoundation / mainframer

Tool for remote builds. Sync project to remote machine, execute command, sync back.
Apache License 2.0
1.73k stars 161 forks source link

Use `tracing` crate instead of `println` #283

Open akshob opened 1 year ago

akshob commented 1 year ago

Currently logs are printed on the command line via println. Replacing all the logs with tracing::info! and tracing::debug! would give flexibility with where we show the output - terminal, log file, or upload to a telemetry service using open telemetry. It is also possible to pipe the stdout and stderr of rysnc and gradlew, so we can choose to filter it out (without relevant command line argument).

Thoughts?

artem-zinnatullin commented 1 year ago

Currently all the logs that Mainframer prints are expected to be seen by user

Perhaps we could add --quiet flag that might rely on something like tracing to suppress the output.

With regards to logging into a log file or uploads to telemetry servers — this is not needed as Mainfraimer is a CLI tool for users, not a backend service or something like this I'd say :)