Reverting to previous formatting

This reverts (but with minor changes) to previous formatting.  Not sure
if it works.
This commit is contained in:
Jigme Datse Yli-Rasku 2024-05-29 22:02:01 -07:00
parent 6f611f22cc
commit b6182b204a
2 changed files with 8 additions and 2 deletions

View File

@ -14,4 +14,7 @@ This is our current version trying to communicate between courier and mailman3.
* Moved logging initialization, and included print statements. * Moved logging initialization, and included print statements.
* OK, it's logging now (it may have been but not in the right location) * OK, it's logging now (it may have been but not in the right location)
* It wasn't formatting correctly. * It wasn't formatting correctly.
* Testing different way to handle formatting. * Testing different way to handle formatting.
* Nope used `Format` not `Formater`.
* This is not working
* Reverting to previous formatting

View File

@ -17,7 +17,10 @@ logger = logging.getLogger(__name__)
logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO) logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO)
FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s' 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)') logger.info('Starting Logging (outside try)')
print('Starting Logging (outside try)') print('Starting Logging (outside try)')