-
Notifications
You must be signed in to change notification settings - Fork 5
Adds support for custom alerthandlers #513
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
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.
Added minor change requests.
@@ -155,6 +157,7 @@ def alert_raise( | |||
data: dict = None, | |||
timestamp: float = None, | |||
traceback: dict = None, | |||
send_alert: bool = True, |
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 used anymore?
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.
this used from the new handler, cause I raise alert in case the alert can not be sent
or should we log instead?
"""Register new alert handler | ||
|
||
Arguments: | ||
handler {callable} -- error handler callable |
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.
Should be:
handler {callable} -- error handler callable | |
handler (callable): error handler callable |
handler {callable} -- error handler callable | ||
|
||
Keyword Arguments: | ||
level {int} -- exception level (default: {40}) |
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.
Should be:
level {int} -- exception level (default: {40}) | |
level (int): exception level (default: 40) |
level {int} -- exception level (default: {40}) | ||
""" | ||
if (handler, level) not in self.handlers: | ||
self.handlers.append((handler, level)) |
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.
No new line at the end of the file.
0757ade
to
71534d7
Compare
Signed-off-by: Ashraf Fouda <[email protected]>
71534d7
to
d87b468
Compare
Codecov Report
@@ Coverage Diff @@
## development #513 +/- ##
===============================================
+ Coverage 68.56% 69.94% +1.38%
===============================================
Files 85 84 -1
Lines 3941 3820 -121
===============================================
- Hits 2702 2672 -30
+ Misses 1239 1148 -91
Continue to review full report at Codecov.
|
Signed-off-by: Ashraf Fouda <[email protected]>
Signed-off-by: Ashraf Fouda [email protected]
Description
Adds support for custom alert handlers