lsst.ctrl.pool  14.0-1-ga2912ff+12
log.py
Go to the documentation of this file.
1 from future import standard_library
2 standard_library.install_aliases()
3 import os
4 import copyreg
5 
6 import lsst.log as lsstLog
7 from lsst.utils import getPackageDir
8 
9 def pickleLog(log):
10  """Pickle a log
11 
12  Assumes that we're always just using the lsst.log default.
13  """
14  return lsstLog.Log, tuple()
15 
16 copyreg.pickle(lsstLog.Log, pickleLog)
17 
18 
19 def jobLog(job):
20  """Add a job-specific log destination"""
21  if job is None or job == "None":
22  return
23  machine = os.uname()[1].split(".")[0]
24  packageDir = getPackageDir("ctrl_pool")
25  # Set the environment variable which names the output file
26  os.environ['JOBNAME'] = job
27  lsstLog.configure(os.path.join(packageDir, "config/log4cxx.properties"))
28  lsstLog.MDC("PID", os.getpid())
def pickleLog(log)
Definition: log.py:9
def jobLog(job)
Definition: log.py:19