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-31152: Fix line/file reporting for .warning and .fatal #58

Merged
merged 1 commit into from
Jul 21, 2021
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
8 changes: 6 additions & 2 deletions python/lsst/log/log/logContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def warn(self, fmt, *args):
self._log(Log.WARN, False, fmt, *args)

def warning(self, fmt, *args):
self.warn(fmt, *args)
# Do not call warn() because that will result in an incorrect
# line number in the log.
self._log(Log.WARN, False, fmt, *args)

def error(self, fmt, *args):
self._log(Log.ERROR, False, fmt, *args)
Expand All @@ -126,7 +128,9 @@ def fatal(self, fmt, *args):
self._log(Log.FATAL, False, fmt, *args)

def critical(self, fmt, *args):
self.fatal(fmt, *args)
# Do not call fatal() because that will result in an incorrect
# line number in the log.
self._log(Log.FATAL, False, fmt, *args)

@deprecated(reason="f-string log messages are now deprecated to match python logging convention."
" Will be removed after v25",
Expand Down