summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/__init__.py10
-rw-r--r--updatewcs/__init__.py6
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/__init__.py b/lib/__init__.py
index bbed8ae..e2380a8 100644
--- a/lib/__init__.py
+++ b/lib/__init__.py
@@ -15,16 +15,6 @@ import distortion
import pywcs
from pytools import fileutil
-import logging
-log_filename = 'stwcs.log'
-logging.basicConfig(filename=log_filename, level=logging.DEBUG, filemode='w')
-formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
-logger = logging.getLogger('STWCS')
-logger.setLevel(logging.DEBUG)
-fh = logging.FileHandler(log_filename)
-fh.setLevel(logging.DEBUG)
-fh.setFormatter(formatter)
-logger.addHandler(fh)
__docformat__ = 'restructuredtext'
DEGTORAD = fileutil.DEGTORAD
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py
index c98e67f..ab852d0 100644
--- a/updatewcs/__init__.py
+++ b/updatewcs/__init__.py
@@ -77,6 +77,12 @@ def updatewcs(input, vacorr=True, tddcorr=True, npolcorr=True, d2imcorr=True,
if verbose == False:
logger.setLevel(100)
else:
+ formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
+ log_filename = 'stwcs.log'
+ fh = logging.FileHandler(log_filename, mode='w')
+ fh.setLevel(logging.DEBUG)
+ fh.setFormatter(formatter)
+ logger.addHandler(fh)
logger.setLevel(verbose)
args = "vacorr=%s, tddcorr=%s, npolcorr=%s, d2imcorr=%s, checkfiles=%s, \
wcskey=%s, wcsname=%s, clobber=%s" % (str(vacorr), str(tddcorr), str(npolcorr),