public inbox for cygwin-apps-cvs@sourceware.org help / color / mirror / Atom feed
From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-68-gd46156e Date: Sun, 16 Apr 2017 20:43:00 -0000 [thread overview] Message-ID: <20170416204338.7126.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d46156e37b30826a949b4bbe3b5576672b98fbb3 commit d46156e37b30826a949b4bbe3b5576672b98fbb3 Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Sun Apr 16 20:19:03 2017 +0100 Downgrade signal logging to debug https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=58a8b6d4b8759f2db8c2003694a1cf6db68fd45b commit 58a8b6d4b8759f2db8c2003694a1cf6db68fd45b Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Thu Apr 6 12:47:31 2017 +0100 Try to use fewer long paths in file move logging https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=5c05a598d8230e55417f94b6615900a704d231d2 commit 5c05a598d8230e55417f94b6615900a704d231d2 Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Thu Apr 6 12:46:47 2017 +0100 Append a summary of severities to log email Diff: --- calm/buffering_smtp_handler.py | 9 +++++++++ calm/calm.py | 8 ++++---- calm/uploads.py | 8 ++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/calm/buffering_smtp_handler.py b/calm/buffering_smtp_handler.py index 0025a5b..81a107b 100644 --- a/calm/buffering_smtp_handler.py +++ b/calm/buffering_smtp_handler.py @@ -52,6 +52,15 @@ class BufferingSMTPHandler(logging.handlers.BufferingHandler): s = self.format(record) msg = msg + s + "\r\n" + # append a summary of severities + summary = {} + + for record in self.buffer: + summary[record.levelname] = summary.get(record.levelname, 0) + 1 + + msg = msg + 'SUMMARY: ' + ', '.join(['%d %s(s)' % (v, k) for (k, v) in summary.items()]) + "\r\n" + + # build the email m = email.message.Message() m['From'] = self.fromaddr m['To'] = ','.join(self.toaddrs) diff --git a/calm/calm.py b/calm/calm.py index 0a66074..afb98bd 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -455,24 +455,24 @@ def do_daemon(args, state): # signals! the first, and best, interprocess communications mechanism! :) def sigusr1(signum, frame): - logging.info("SIGUSR1") + logging.debug("SIGUSR1") nonlocal read_uploads read_uploads = True def sigusr2(signum, frame): - logging.info("SIGUSR2") + logging.debug("SIGUSR2") nonlocal read_relarea read_relarea = True def sigalrm(signum, frame): - logging.info("SIGALRM") + logging.debug("SIGALRM") nonlocal read_relarea read_relarea = True nonlocal read_uploads read_uploads = True def sigterm(signum, frame): - logging.info("SIGTERM") + logging.debug("SIGTERM") nonlocal running running = False diff --git a/calm/uploads.py b/calm/uploads.py index d9a172d..db1a23b 100644 --- a/calm/uploads.py +++ b/calm/uploads.py @@ -252,10 +252,10 @@ def move(args, movelist, fromdir, todir): os.makedirs(os.path.join(todir, p), exist_ok=True) except FileExistsError: pass - logging.info("move from '%s' to '%s':" % (os.path.join(fromdir, p), os.path.join(todir, p))) + logging.debug("move from '%s' to '%s':" % (os.path.join(fromdir, p), os.path.join(todir, p))) for f in sorted(movelist[p]): if os.path.exists(os.path.join(fromdir, p, f)): - logging.info("%s" % (f)) + logging.info("%s" % os.path.join(p, f)) if not args.dryrun: os.rename(os.path.join(fromdir, p, f), os.path.join(todir, p, f)) else: @@ -263,6 +263,8 @@ def move(args, movelist, fromdir, todir): def move_to_relarea(m, args, movelist): + if movelist: + logging.info("move from %s's upload area to release area:" % (m.name)) move(args, movelist, m.homedir(), args.rel_area) # XXX: Note that there seems to be a separate process, not run from # cygwin-admin's crontab, which changes the ownership of files in the @@ -270,6 +272,8 @@ def move_to_relarea(m, args, movelist): def move_to_vault(args, movelist): + if movelist: + logging.info("move from release area to vault:") move(args, movelist, args.rel_area, args.vault)
reply other threads:[~2017-04-16 20:43 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170416204338.7126.qmail@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-apps-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).