-
Notifications
You must be signed in to change notification settings - Fork 287
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
Allowing users to customize timestamp format printed by pretty_ts() function #407
Allowing users to customize timestamp format printed by pretty_ts() function #407
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.
Thanks for the contribution!
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'm very sorry for the bugs I've introduced.
I have found the typo that seems to be the cause of the problem.
I'll fix this in another PR.
@@ -78,6 +78,7 @@ def load_conf(args, defaults=None, overwrites=None): | |||
conf.setdefault('disable_rules_on_error', True) | |||
conf.setdefault('scan_subdirectories', True) | |||
conf.setdefault('rules_loader', 'file') | |||
conf.setdefault('custum_pretty_ts_format', None) |
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.
There is a typo in this line
NG: conf.setdefault('custum_pretty_ts_format', None)
OK: conf.setdefault('custom_pretty_ts_format', None)
Description
This PR adds optional configuration of
custom_pretty_ts_format
, which provides a way to define custom format of timestamps printed in log messages and in alert messages.This function is realized by modifying pretty_ts() function inutil.py
and its related components.custom_pretty_ts_format
is expected to be specified like this inconfig.yaml
.Checklist
make test-docker
with my changes.Questions or Comments
CHANGELOG.md will be updated after the number of PR is fixed.Updating CHANGELOG.md has been done.