-
Notifications
You must be signed in to change notification settings - Fork 96
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
Issue 6468 - RFE - CLI - Add logging settings to dsconf #6469
Conversation
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.
I think it should be possible to create helper functions to generate common parsers, reducing duplication. Most of the attributes repeat across different log types.
Something like?..
For all of them in a for loop
(this part will really reduce the redundancy):
_add_enable_disable_parsers(set_parsers, log_type)
_add_location_parser(set_parsers, log_type)
_add_compression_parsers(set_parsers, log_type)
etc..
And the rest for special cases where we can't use for loop
for all of them.
Another thing:
I think, we need to add a bit more validation where it's possible (time format and sizes?)
def test_log_settings(topo): | ||
"""Test each log settings can be set successfully | ||
|
||
:id: ffc912a6-c188-413d-9c35-7f4b3774d946 |
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.
duplicate id
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.
Yeah meant to fix that but forgot. This was a side project of mine that I've slowly been working on for the last few months.
We already do the validation in the core server (libglobs.c). I don't see the need to duplicate it in the CLI. The CLI will correctly report the error message from the server. |
Yeah, I agree. I just worry that UI depends on Also, CLI output looks a bit not clean:
IMHO, it'll be nice to have a clean But we can get the validation error from the exception and parse it correctly in UI and CLI. And we can deal with it in a different ticket, probablly. So, yeah, discard this concern. :) |
Ugh that is ugly
Hmm, yeah we use generic error handling in the CLI. It was never clean. I think it would be nice to improve it - perhaps that will be my next side project :-) |
Description: It would be nice to have a more friendly CLI interface for managing the server logging. Specifically the log levels. This PR adds a new subcommand "logging" that can handle each log type and allthe settings for it. relates: 389ds#6468 Reviewed by: spichugi(Thanks!)
bad1da4
to
013c05e
Compare
@droideck Requested changes made. I just lumped all the settings into a single loop instead of having separate functions for common parsers |
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.
Looks great! Ack
Description:
It would be nice to have a more friendly CLI interface for managing the server logging. Specifically the log levels. This PR adds a new subcommand "logging" that can handle each log type and all the settings for it.
relates: #6468