IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2012, 12:02:48 PM (14 years ago)
Author:
rhenders
Message:

Big changes to support a new Config class that encapuslates the xml config file

File:
1 edited

Legend:

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

    r33192 r33259  
    77
    88   '''
    9    Sets up logging using values from the ippToPsps config file
     9   Sets up logging using provided values and this process hostname and PID if sending to file
     10   This will default to stout and no file output
    1011   '''
    11    def setup(self, doc, name, stdout=1, sendToFile=0, host="host", pid=1234):
     12   def setup(self, name, basePath, dvoLabel, stdout=1, sendToFile=0):
    1213
    1314       formatter = logging.Formatter('%(asctime)s | %(levelname)7s | %(message)s', '%Y-%m-%d %H:%M:%S')
     
    1516
    1617       if sendToFile:
    17            PATH = doc.find("localOutPath").text + "/log"
     18
     19           HOST = socket.gethostname()
     20           PID = os.getpid()
     21
     22           # generate path
     23           PATH = basePath + "/log"
    1824           if not os.path.exists(PATH): os.makedirs(PATH)
    19            DVOLABEL = doc.find("dvo/gpc1Label").text
    20            FULLPATH = PATH + "/" + name + "_" + DVOLABEL + "_" + host + "_" + str(pid) + ".log"
     25           FULLPATH = PATH + "/" + name + "_" + dvoLabel + "_" + HOST + "_" + str(PID) + ".log"
    2126
    2227           # opens file to be appended
Note: See TracChangeset for help on using the changeset viewer.