Moving Logging and adding prints.
This commit is contained in:
parent
f095619494
commit
f3a169208b
|
@ -11,3 +11,4 @@ This is our current version trying to communicate between courier and mailman3.
|
|||
* Which I screwed up. I think I was typing in the wrong window.
|
||||
* It's not failing on command line.
|
||||
* Still failing, let's get some logging.
|
||||
* Moved logging initialization, and included print statements
|
|
@ -11,20 +11,24 @@
|
|||
# $3 LMTP Host
|
||||
# std_in message text
|
||||
|
||||
try:
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import smtplib
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
logging.basicConfig(filename='~/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'
|
||||
logging.basicConfig(format=FORMAT)
|
||||
|
||||
logger.info('Starting Logging')
|
||||
logger.info('Starting Logging (outside try)')
|
||||
print('Starting Logging (outside try)')
|
||||
|
||||
try:
|
||||
import os
|
||||
import sys
|
||||
import smtplib
|
||||
|
||||
logger.info('Starting Logging (inside try)')
|
||||
print('Starting Logging (inside try)')
|
||||
|
||||
# Setup LTMP connection
|
||||
lmtp_host = sys.argv[3] if len(sys.argv) > 3 else 'localhost'
|
||||
|
|
Loading…
Reference in New Issue