Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2022-06-07 12:59:18 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2022-06-07 18:17:02 +0300
commit867e172bf9c1095c0939551398b83ce47647d18f (patch)
tree8a5abb4e4afa2a4671a26f84e7f244a3ba27884e
parentf2af73f6d9f220c3b3d211edfae4e69966f31beb (diff)
Only mail leads log records of ERROR or higher
Emulate the behaviour of retainLevel=ERROR for the leads email, as we had prior to a1cb1581.
-rwxr-xr-xcalm/calm.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/calm/calm.py b/calm/calm.py
index 62dc902..63cdc60 100755
--- a/calm/calm.py
+++ b/calm/calm.py
@@ -630,12 +630,13 @@ def mail_cb(state, loghandler):
if not state.args.email:
return
- # if there are any log records of ERROR level or higher, send all records to
- # leads
+ # if there are any log records of ERROR level or higher, send those records
+ # to leads
if any([record.levelno >= logging.ERROR for record in loghandler.buffer]):
leads_email = BufferingSMTPHandler(state.args.email, subject='%s' % (state.subject))
for record in loghandler.buffer:
- leads_email.handle(record)
+ if record.levelno >= logging.ERROR:
+ leads_email.handle(record)
leads_email.close()
# send each maintainer mail containing log entries caused by their actions,