-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix doctor: add more logging output to checks #3102
Conversation
New output looks like this:
And when in the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
src/nix/doctor.cc
Outdated
} | ||
|
||
bool checkNixInPath() | ||
{ | ||
std::cout << "INFO: Checking that there is only one nix on PATH." << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is useful information it might be better to only log the steps on debug level instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logically this feels like a test suite, which generally print all the tests run with their status. Particularly with the colorized output now, there's something to be said for the warm fuzzy feeling of seeing a bunch of green PASSes scroll by :)
Since the tests that we run are conditional on the system config, as well, I think it's reasonable to print them all. Maybe if someday we have dozens of checks it might be worth reconsidering, but as of now we only have 3.
Maybe we can colorize the output? Like in the
|
When running nix doctor on a healthy system, it just prints the store URI and nothing else. This makes it unclear whether the system is in a good state and what check(s) it actually ran, since some of the checks are optional depending on the store type. This commit updates nix doctor to print an colored log message for every check that it does, and explicitly state whether that check was a PASS or FAIL to make it clear to the user whether the system passed its checkup with the doctor. Fixes NixOS#3084
a9ec504
to
c5bd564
Compare
Thanks for the tip @edolstra! I've rewritten the output to use the standard In the first run I'm in the Looks nice with the colors now! |
@edolstra any thoughts on how it looks now? We could also use the
|
Thanks! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-optimise-store-skipping-suspicious-writable-file/5394/2 |
When running
nix doctor
on a healthy system, it just prints the store URI andnothing else. This makes it unclear whether the system is in a good state and
what check(s) it actually ran, since some of the checks are optional depending
on the store type.
This commit updates
nix doctor
to print anINFO
log for every check that itdoes, and to print a final message saying whether all checks passed or not. This
makes it clear to the user whether they've passed the checkup or not with the doctor.
Fixes #3084