Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

import os 

import copyreg 

import lsst.log as lsstLog 

from lsst.utils import getPackageDir 

 

 

def pickleLog(log): 

"""Pickle a log 

 

Assumes that we're always just using the lsst.log default. 

""" 

return lsstLog.Log, tuple() 

 

 

copyreg.pickle(lsstLog.Log, pickleLog) 

 

 

def jobLog(job): 

"""Add a job-specific log destination""" 

if job is None or job == "None": 

return 

packageDir = getPackageDir("ctrl_pool") 

# Set the environment variable which names the output file 

os.environ['JOBNAME'] = job 

lsstLog.configure(os.path.join(packageDir, "config/log4cxx.properties")) 

lsstLog.MDC("PID", os.getpid())