From b6182b204afcc8929eca6dc7ddb2c4e6a4f74d6b Mon Sep 17 00:00:00 2001 From: Jigme Datse Yli-Rasku Date: Wed, 29 May 2024 22:02:01 -0700 Subject: [PATCH] Reverting to previous formatting This reverts (but with minor changes) to previous formatting. Not sure if it works. --- docs/courier-to-mailman3.md | 5 ++++- source/courier-to-mailman3.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index 52f883b..153c43a 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -14,4 +14,7 @@ This is our current version trying to communicate between courier and mailman3. * Moved logging initialization, and included print statements. * OK, it's logging now (it may have been but not in the right location) * It wasn't formatting correctly. -* Testing different way to handle formatting. \ No newline at end of file +* Testing different way to handle formatting. + * Nope used `Format` not `Formater`. + * This is not working +* Reverting to previous formatting \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index 11579bb..df354a4 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -17,7 +17,10 @@ logger = logging.getLogger(__name__) logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO) FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s' -logger.Formater(FORMAT) +logging.basicConfig(format=FORMAT) + +logger.info('format set to: %s', FORMAT) +print('format set to: %s', FORMAT) logger.info('Starting Logging (outside try)') print('Starting Logging (outside try)')