Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pex changed for default logging #29

Merged
merged 1 commit into from
Aug 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/lsst/base/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
import hashlib
import importlib
import subprocess
import logging
import pickle as pickle
from collections import Mapping

from .versions import getRuntimeVersions

log = logging.getLogger(__name__)

__all__ = ["getVersionFromPythonModule", "getPythonPackages", "getEnvironmentPackages", "Packages"]


Expand Down Expand Up @@ -159,8 +162,7 @@ def getEnvironmentPackages():
from eups import Eups
from eups.Product import Product
except ImportError:
from lsst.pex.logging import getDefaultLog
getDefaultLog().warn("Unable to import eups, so cannot determine package versions from environment")
log.warning("Unable to import eups, so cannot determine package versions from environment")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this? I thought it was log.warn.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It works (we noticed this because eups did not load for @gcomoretto). Python logging prefers logging.warning and deprecates logging.warn (we don't use lsst.log here)

return {}

# Cache eups object since creating it can take a while
Expand Down