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

DM-30301: Change Task logging from lsst.log to python logging #191

Merged
merged 27 commits into from Jul 28, 2021

Conversation

timj
Copy link
Member

@timj timj commented Jul 9, 2021

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

python/lsst/pipe/base/task_logging.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/argumentParser.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/task.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/task_logging.py Outdated Show resolved Hide resolved
tgoldina and others added 19 commits July 26, 2021 16:09
Uses a special subclass of logging.Logger to allow some
period of migration for usage in existing Tasks.
LoggingAdapter can apply to the root logger so allows for more
consistency in usage.
Messages are still all forwarded to lsst.log for now.
Using self.log is not reliable since it might not be an
lsst.log object any more.
We may end up always using this special logger.
Caller code should be fixed to configure logging or lsst.log
as needed.
* verbose and trace are generally useful and may indicate
  we should always be using this log adapter.
* Trap large log levels and assume they are lsst.log constants.
* Add more Logger compatibility forwarding.
Python does not provide fatal() method on LoggingAdapter
even though it does provide warn().
For verbose/trace/infof etc the messages were being reported
from the wrong line. Setting stacklevel allows the log to
report the correct line.
For now, we attach these constants to the log adapter so that
it is easier to access the VERBOSE and TRACE constants.
Do not deprecated any of them since python logging does not
deprecated any (including WARN or FATAL).
Getting the constants directly from the logger ensures
self consistency for the Task user and hides the
specific logging system from the Task.
For now assume that the log adapter for Task is going to
exist as more than a transition class for the migration
from lsst.log.
Since python itself does not deprecate it.
This makes the intent more explicit.
timj and others added 5 commits July 26, 2021 16:34
Co-authored-by: Kian-Tat Lim <ktl@slac.stanford.edu>
Recreate a new logger using the name from the supplied logger.
This makes it more consistent with what `Task` is doing
internally.
@timj timj merged commit 1b72f1f into master Jul 28, 2021
@timj timj deleted the tickets/DM-30301 branch July 28, 2021 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants