Skip to content

Commit

Permalink
Use lsst prefix for all loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Nov 10, 2021
1 parent 69bf567 commit 1a45376
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion python/lsst/obs/base/_fitsRawFormatterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from .makeRawVisitInfoViaObsInfo import MakeRawVisitInfoViaObsInfo
from .utils import createInitialSkyWcsFromBoresight, InitialSkyWcsError

log = logging.getLogger("fitsRawFormatter")
log = logging.getLogger(__name__)


class FitsRawFormatterBase(FitsImageFormatterBase):
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/obs/base/cameraMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(self, policy, repositoryDir,

dafPersist.Mapper.__init__(self)

self.log = lsstLog.Log.getLogger("CameraMapper")
self.log = lsstLog.Log.getLogger("lsst.CameraMapper")

if root:
self.root = root
Expand Down Expand Up @@ -1527,7 +1527,7 @@ def exposureFromImage(image, dataId=None, mapper=None, logger=None, setVisitInfo
if setVisitInfo and exposure.getInfo().getVisitInfo() is None:
if mapper is None:
if not logger:
logger = lsstLog.Log.getLogger("CameraMapper")
logger = lsstLog.Log.getLogger("lsst.CameraMapper")
logger.warn("I can only set the VisitInfo if you provide a mapper")
else:
exposureId = mapper._computeCcdExposureId(dataId)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/gen2to3/convertTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _run_convert(self):
"""

# Turn on logging
log = logging.getLogger("convertRepo")
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
log.info("Converting %s to %s", self.gen2root, self.gen3root)

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/gen2to3/repoWalker/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __init__(self, log: Optional[logging.Logger] = None, progress: Optional[Prog
self._files = []
self._subdirectories = []
if log is None:
log = logging.getLogger("obs.base.gen2to3.walker")
log = logging.getLogger("lsst.obs.base.gen2to3.repoWalker")
self.log = log
self.progress = progress

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/gen2to3/repoWalker/walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, inputs: Iterable[Union[Target, Skip]], *,
progress: Optional[Progress] = None):
super().__init__()
if log is None:
log = logging.getLogger("obs.base.gen2to3.TranslatorFactory")
log = logging.getLogger("lsst.obs.base.gen2to3.repoWalker")
self.log = log
tree = BuilderTree(progress)
allKeys: Dict[str, type] = {}
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/gen2to3/translators.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def __init__(self, log: Optional[logging.Logger] = None):
}
self._addDefaultRules()
if log is None:
log = logging.getLogger("obs.base.gen2to3.TranslatorFactory")
log = logging.getLogger(__name__)
self.log = log

def __str__(self):
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/obs/base/makeRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class MakeRawVisitInfo:
----------
log : `logging.Logger` or None
Logger to use for messages.
(None to use ``logging.getLogger("MakeRawVisitInfo")``).
(None to use ``logging.getLogger("lsst.obs.base.makeRawVisitInfo")``).
doStripHeader : `bool`, optional
Strip header keywords from the metadata as they are used?
"""

def __init__(self, log=None, doStripHeader=False):
if log is None:
log = logging.getLogger("MakeRawVisitInfo")
log = logging.getLogger(__name__)
self.log = log
self.doStripHeader = doStripHeader

Expand Down
5 changes: 3 additions & 2 deletions python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class MakeRawVisitInfoViaObsInfo:
----------
log : `logging.Logger` or None
Logger to use for messages.
(None to use ``Log.getLogger("MakeRawVisitInfoViaObsInfo")``).
(None to use
``Log.getLogger("lsst.obs.base.makeRawVisitInfoViaObsInfo")``).
doStripHeader : `bool`, optional
Strip header keywords from the metadata as they are used?
"""
Expand All @@ -71,7 +72,7 @@ class MakeRawVisitInfoViaObsInfo:

def __init__(self, log=None, doStripHeader=False):
if log is None:
log = logging.getLogger("MakeRawVisitInfoViaObsInfo")
log = logging.getLogger(__name__)
self.log = log
self.doStripHeader = doStripHeader

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/script/defineVisits.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from lsst.obs.base import DefineVisitsTask, DefineVisitsConfig
from ..utils import getInstrument

log = logging.getLogger("defineVisits")
log = logging.getLogger("lsst.obs.base.defineVisits")


def defineVisits(repo, config_file, collections, instrument, processes=1, raw_name="raw"):
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def setUp_tests(self, butler, mapper, dataIds):
self.butler = butler
self.mapper = mapper
self.dataIds = dataIds
self.log = logging.getLogger('ObsTests')
self.log = logging.getLogger(__name__)

def tearDown(self):
del self.butler
Expand Down

0 comments on commit 1a45376

Please sign in to comment.