-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Make corral less verbose #137
Conversation
Noticed #133 after opening this. I am happy to hold and rebase until after that is merged, or scrap this PR if that one intends to address this issue as well 👍 |
Looks like tests will also need to be updated as they are evaluating the old output |
I would say, make the tests work with new output and let's start a discussion in the #tooling stream on zulip to find better test to replace the brittle output tests. |
@hasheddan #133 is unrelated. |
@SeanTAllen I just updated the failing tests to run with |
Seems like a good idea. Can you open an issue that details which tests are using the output so we can start working out replacements? |
@SeanTAllen sure thing! |
Rather than changing the log level to fine, I think that by default only verbosity with existing logger should be And when #133 is done, the default logger level would be This would fit with the general command line tool idea of "by default, only print errors". @Theodus thoughts? |
@SeanTAllen that makes sense 👍 My reasoning for changing to |
Dropping a note here from Pony sync call this week: instead of changing these log levels across the board, we could pass a different logger for "informational commands" and let Any thoughts on this @SeanTAllen? |
What's an informational command? |
|
So fetch, init, update are "non-informational", anything else non-informational? |
I would say |
@hasheddan This sounds very reasonable. |
@SeanTAllen nice! I will update and ping you later this evening when ready for another review 👍 |
This passes a different logger for informational commands (commands that have the explicit purpose of printing output) and executing commands (commands that perform an action other than printing output). Executing commands should not print output unless a --verbose flag is passed. Informational commands should print output whether a --verbose flag is provided or not. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This is a temporary workaround for satiating fetch and update tests that require checking text printed to std out. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
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.
@SeanTAllen Did a quick refactor here. It seems to fix the problem we are trying to address, but I don't think it is our ultimate final state. Let me know if you want additional work here before merge :)
@@ -48,5 +50,5 @@ actor Main | |||
|
|||
// Hand off to Executor to resolve required dirs and execute the command | |||
Executor.execute( | |||
command, env, log, uout, | |||
command._1, env, log, command._2, |
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.
Not sure how elegant this is in Pony vernacular. Seems like it might be worth refactoring the Executor
in the future, but this felt like the lower friction move for now. Happy to adjust if you prefer another pattern 👍
@hasheddan My statement: it fixes a problem. Yeah, we don't want this as a final state. I think a better "closer to final" state is for each command "carry" the "logger" with it. Commands are really anemic at this point. I think it makes sense for when a command is created for this log level to be set. Perhaps there is a trait for an informational vs action command that each command will implement and it can then somehow "select" the correct logging. Otoh, that might be really ugly. Can you open an issue for this to be cleaned up more? Rather than "just fixing" that issue, I'd like to see it done as part of writing tests to replace the ones that you had to modify to make this pass. I think if we have tests like "Fetch will only output if X" and "Fetch won't output when Y" then we will end up at a good solid testable design, does that sound good to you? If yes, I'm good with merging this once you have opened that issue/updated #138 to incorporate these additional notes. |
@SeanTAllen done 👍 #140 |
Thanks @hasheddan! |
This updates most non-log prints to stdout to have a log level of fine
such that they will only be displayed when the --verbose flag is passed.
Some commands are ommitted from this change, such as info, version, and
list as their explicit purpose is to print information.
Fixes #101
Signed-off-by: hasheddan georgedanielmangum@gmail.com