Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Trevor Cappallo
OperationalLogging
Commits
5294a255
Commit
5294a255
authored
Sep 01, 2015
by
Trevor Cappallo
Browse files
appropriate email log level for crit
parent
f85f4775
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lib/OperationalLogger.py
lib/OperationalLogger.py
+3
-1
No files found.
lib/OperationalLogger.py
View file @
5294a255
...
...
@@ -36,17 +36,19 @@ def __exit_handler(logger, notify):
pass
if
logger
.
has_errors
():
lev
=
logging
.
ERROR
addresses
=
notify
[
'ERROR'
]
print
"before addresses:"
,
addresses
if
notify
[
'DEBUG'
]:
addresses
.
extend
(
notify
[
'DEBUG'
])
if
logger
.
has_critical
()
and
notify
[
'CRITICAL'
]:
lev
=
logging
.
CRITICAL
addresses
=
addresses
.
extend
(
notify
[
'CRITICAL'
])
if
not
addresses
:
logging
.
warning
(
'There were errors, but no recipients specified. No email sent.'
)
else
:
addresses
=
list
(
set
(
addresses
))
logger
.
email_log
(
addresses
)
logger
.
email_log
(
addresses
,
level
=
lev
)
print
"after addresses"
,
addresses
print
"notify ="
,
notify
elif
notify
[
'DEBUG'
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment