IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2012, 2:49:37 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippToPsps/jython/pslogger.py

    r32464 r33638  
    33import os
    44import sys
     5import socket
    56
    67class PSLogger(logging.getLoggerClass()):
    78
    89   '''
    9    Sets up logging using values from the ippToPsps config file
     10   Sets up logging using provided values and this process hostname and PID if sending to file
     11   This will default to stout and no file output
    1012   '''
    11    def setup(self, doc, name, stdout=1, sendToFile=0, host="host", pid=1234):
     13   def setup(self, programName, basePath, configName, host, pid, stdout=1, sendToFile=0):
    1214
    1315       formatter = logging.Formatter('%(asctime)s | %(levelname)7s | %(message)s', '%Y-%m-%d %H:%M:%S')
     
    1517
    1618       if sendToFile:
    17            PATH = doc.find("localOutPath").text + "/log"
     19
     20           # generate path
     21           PATH = basePath + "/log"
    1822           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"
    21 
     23           FULLPATH = PATH + "/" + programName + "_" + configName + "_" + host + "_" + str(pid) + ".log"
    2224           # opens file to be appended
    2325           hdlr = logging.FileHandler(FULLPATH, "a")
     
    2729       if stdout:
    2830           stdout = logging.StreamHandler(sys.__stdout__)
    29            #stdout.setFormatter(formatter)
     31           stdout.setFormatter(formatter)
    3032           self.addHandler(stdout)
    3133
Note: See TracChangeset for help on using the changeset viewer.