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. 7c5af85e5a6da60a9c32453cca782fbea5b7add9 Date: Fri, 18 Mar 2016 19:24:00 -0000 [thread overview] Message-ID: <20160318192452.35371.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=7c5af85e5a6da60a9c32453cca782fbea5b7add9 commit 7c5af85e5a6da60a9c32453cca782fbea5b7add9 Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Fri Mar 18 19:21:23 2016 +0000 Write detailed calm log output to a file Also write detailed calm log output to a file Rotate this log file on each run Send normal output to stdout, rather than stderr Downgrade a verycommon message from update_package_listings() to DEBUG v2 Make log directory configurable with --logdir Leave mails at WARNING log level Diff: --- buffering_smtp_handler.py | 1 + calm | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/buffering_smtp_handler.py b/buffering_smtp_handler.py index 98183a4..16d9bc8 100644 --- a/buffering_smtp_handler.py +++ b/buffering_smtp_handler.py @@ -41,6 +41,7 @@ class BufferingSMTPHandler(logging.handlers.BufferingHandler): self.toaddrs = toaddrs self.subject = subject self.formatter = logging_format + self.setLevel(logging.WARNING) self.setFormatter(logging.Formatter(logging_format)) def flush(self): diff --git a/calm b/calm index 92fbdcb..9638d9e 100755 --- a/calm +++ b/calm @@ -146,6 +146,7 @@ if __name__ == "__main__": pkglist_default = common_constants.PKGMAINT relarea_default = common_constants.FTP vault_default = common_constants.VAULT + logdir_default = '/sourceware/cygwin-staging/logs' parser = argparse.ArgumentParser(description='Upset replacement') parser.add_argument('--arch', action='store', required=True, choices=common_constants.ARCHES) @@ -154,6 +155,7 @@ if __name__ == "__main__": parser.add_argument('--homedir', action='store', metavar='DIR', help="maintainer home directory (default: " + homedir_default + ")", default=homedir_default) parser.add_argument('--htdocs', action='store', metavar='DIR', help="htdocs output directory (default: " + htdocs_default + ")", default=htdocs_default) parser.add_argument('--inifile', '-u', action='store', help='output filename', required=True) + parser.add_argument('--logdir', action='store', metavar='DIR', help="log directory (default: '" + logdir_default + "')", default=logdir_default) parser.add_argument('--orphanmaint', action='store', metavar='NAMES', help="orphan package maintainers (default: '" + orphanmaint_default + "')", default=orphanmaint_default) parser.add_argument('--pkglist', action='store', metavar='FILE', help="package maintainer list (default: " + pkglist_default + ")", default=pkglist_default) parser.add_argument('--release', action='store', help='value for setup-release key (default: cygwin)', default='cygwin') @@ -166,10 +168,10 @@ if __name__ == "__main__": # set up logging to a file try: - os.makedirs('/var/log/cygwin/', exist_ok=True) + os.makedirs(args.logdir, exist_ok=True) except FileExistsError: pass - rfh = logging.handlers.RotatingFileHandler('/var/log/cygwin/calm.log', backupCount=24) + rfh = logging.handlers.RotatingFileHandler(os.path.join(args.logdir, 'calm.log'), backupCount=24) rfh.doRollover() # force a rotate on every run rfh.setFormatter(logging.Formatter('%(asctime)s - %(levelname)-8s - %(message)s')) rfh.setLevel(logging.INFO)
reply other threads:[~2016-03-18 19:24 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=20160318192452.35371.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).