Author: sebb
Date: Sat Apr  9 23:31:44 2016
New Revision: 1738397

URL: http://svn.apache.org/viewvc?rev=1738397&view=rev
Log:
Convert some prints to logger output

Modified:
    comdev/reporter.apache.org/trunk/scripts/scandist.py

Modified: comdev/reporter.apache.org/trunk/scripts/scandist.py
URL: 
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/scandist.py?rev=1738397&r1=1738396&r2=1738397&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/scandist.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/scandist.py Sat Apr  9 23:31:44 
2016
@@ -213,7 +213,7 @@ def processCommit(commit):
     # "changed": {"comdev/reporter.apache.org/trunk/scandist.py": {"flags": "U 
 "}}, 
     # "date": "2015-07-13 13:38:33 +0000 (Mon, 13 Jul 2015)", "type": "svn", 
"id": 1690668}
     #
-    print("%(id)s %(date)s %(log)s" % commit)
+    logger.info("%(id)s %(date)s %(log)s" % commit)
     # Note: a single commit can change multiple paths
     paths = commit['changed']
     for path in paths:
@@ -383,7 +383,7 @@ def processTargets():
                 email = committer + "@apache.org"
                 tmpdict.update({'email' : email})
                 receivers = [email]
-                print("Notifying '%(committer)s' of new data pushed to 
'%(project)s' in r%(id)s" % tmpdict)
+                logger.info("Notifying '%(committer)s' of new data pushed to 
'%(project)s' in r%(id)s" % tmpdict)
                 message = """From: Apache Reporter Service 
<no-re...@reporter.apache.org>
 To: %(committer)s <%(email)s>
 Reply-To: d...@community.apache.org
@@ -427,9 +427,9 @@ The Apache Reporter Service.
                    smtpObj = smtplib.SMTP('localhost')
                    smtpObj.sendmail(sender, receivers, message)  
                    #print message       
-                   print("Successfully sent email")
-                except Exception as ex:
-                   print("Error: unable to send email", ex)
+                   logger.info("Successfully sent email")
+                except Exception:
+                   logger.exception("Error: unable to send email")
 
 
 ##############


Reply via email to