diff options
author | dencheva <dencheva@stsci.edu> | 2011-03-11 12:33:17 -0500 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2011-03-11 12:33:17 -0500 |
commit | 02f39a3148c28efe169e035450a9fce319d0c412 (patch) | |
tree | 2949ca272831c63a038201c8764259c8805acbf8 /lib/__init__.py | |
parent | 323fea9f61f6220ef4114158c4dd76636d91eab4 (diff) | |
download | stwcs_hcf-02f39a3148c28efe169e035450a9fce319d0c412.tar.gz |
Adding logging to updatewcs
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@12183 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/__init__.py')
-rw-r--r-- | lib/__init__.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/__init__.py b/lib/__init__.py index 9e7c353..bbed8ae 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -11,13 +11,20 @@ functions for manipulating alternate WCS descriptions in the headers. """ from __future__ import division # confidence high -#import all needed modules here to avoid relative imports -#import mappings -#import utils 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 |