Changeset 33259 for trunk/ippToPsps/jython/pslogger.py
- Timestamp:
- Feb 14, 2012, 12:02:48 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/pslogger.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/pslogger.py
r33192 r33259 7 7 8 8 ''' 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 10 11 ''' 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): 12 13 13 14 formatter = logging.Formatter('%(asctime)s | %(levelname)7s | %(message)s', '%Y-%m-%d %H:%M:%S') … … 15 16 16 17 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" 18 24 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" 21 26 22 27 # opens file to be appended
Note:
See TracChangeset
for help on using the changeset viewer.
