Skip to content

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

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

ashraffouda
Copy link
Collaborator

Signed-off-by: Ashraf Fouda [email protected]

Description

Adds support for custom alert handlers

Copy link
Contributor

@abom abom left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used anymore?

Copy link
Collaborator Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be:

Suggested change
handler {callable} -- error handler callable
handler (callable): error handler callable

handler {callable} -- error handler callable

Keyword Arguments:
level {int} -- exception level (default: {40})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be:

Suggested change
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))
Copy link
Contributor

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.

@ashraffouda ashraffouda force-pushed the development_alert_handler branch 2 times, most recently from 0757ade to 71534d7 Compare November 26, 2020 14:56
@ashraffouda ashraffouda force-pushed the development_alert_handler branch from 71534d7 to d87b468 Compare November 26, 2020 15:00
@codecov-io
Copy link

codecov-io commented Nov 26, 2020

Codecov Report

Merging #513 (d87b468) into development (5128c37) will increase coverage by 1.38%.
The diff coverage is n/a.

Impacted file tree graph

@@               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     
Impacted Files Coverage Δ
jumpscale/servers/gedis/server.py 58.63% <0.00%> (-3.67%) ⬇️
jumpscale/clients/redis/redis.py 88.23% <0.00%> (+2.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5128c37...d87b468. Read the comment docs.

@ashraffouda ashraffouda merged commit b15b6b7 into development Nov 30, 2020
@ashraffouda ashraffouda deleted the development_alert_handler branch November 30, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants