This commit is contained in:
adii1823
2021-10-28 17:34:45 +05:30
parent 583ec6a898
commit 8b802c5c62
34 changed files with 332 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
# The send_email function is defined here to enable you to play with
# code, but of course it doesn't send an actual email.
def send_email(*a):
print (*a)
alert_system = 'console' # other value can be 'email'
error_severity = 'critical' # other values: 'medium' or 'low'
error_message = 'OMG! Something terrible happened!'
if alert_system == 'console':
print(error_message) #1
elif alert_system == 'email':
if error_severity == 'critical':
send_email('admin@example.com', error_message) #2
elif error_severity == 'medium':
send_email('support.1@example.com', error_message) #3
else:
send_email('support.2@example.com', error_message) #4