IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2011, 10:26:37 PM (15 years ago)
Author:
rhenders
Message:

Added logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r31198 r31225  
    44import sys
    55import os
     6import logging
    67
    78from java.sql import *
     
    1920
    2021    '''
    21     def __init__(self):
     22    def __init__(self, logger):
    2223
     24        # setup logging
     25        self.logger = logger
     26        self.logger.debug("IppToPspsDb Constructor")
    2327        # open config
    2428        doc = ElementTree(file="config.xml")
     
    3842    def createNewBatch(self, expID, surveyType, batchType, dvoDb, datastoreProduct):
    3943
    40         print "Creating nw batch in ippToPsps database"
    4144        sql = "SELECT batch_id FROM batches ORDER BY batch_id DESC LIMIT 1"
    4245
     
    4851            batchID = rs.getInt(1)
    4952        except:
    50             print "Unable to get batch ID"
     53            self.logger.exception("Unable to get batch ID")
    5154
    5255        if batchID > 0:
     
    7073            self.stmt.execute(sql)
    7174
     75        self.logger.info("Creating new batch in ippToPsps database with batchID = %d" % batchID)
     76
    7277        return batchID;
    7378
     
    7782    def __del__(self):
    7883
    79         print "IppToPspsDb destructor"
     84        self.logger.debug("IppToPspsDb Desstructor")
    8085        self.stmt.close()
    8186        self.con.close()
Note: See TracChangeset for help on using the changeset viewer.