Skip to content

Commit

Permalink
Demote initial ID query explanation to error.
Browse files Browse the repository at this point in the history
Critical is not an appropriate level for informational logs, especially
since whether or not a failed query is truly critical (in the sense
that the program cannot continue) depends on the program.
  • Loading branch information
kfindeisen committed Aug 27, 2024
1 parent fe85a52 commit 1935541
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-45722.other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Explanatory logs for "initial data ID query returned no rows" are now reported at ERROR, not CRITICAL, level.
18 changes: 9 additions & 9 deletions python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,18 +507,18 @@ def from_builder(
yield result

def log_failure(self, log: LsstLogAdapter) -> None:
"""Emit a series of CRITICAL-level log message that attempts to explain
"""Emit a series of ERROR-level log message that attempts to explain
why the initial data ID query returned no rows.
Parameters
----------
log : `logging.Logger`
The logger to use to emit log messages.
"""
log.critical("Initial data ID query returned no rows, so QuantumGraph will be empty.")
log.error("Initial data ID query returned no rows, so QuantumGraph will be empty.")
for message in self.common_data_ids.explain_no_results():
log.critical(message)
log.critical(
log.error(message)
log.error(
"To reproduce this query for debugging purposes, run "
"Registry.queryDataIds with these arguments:"
)
Expand All @@ -527,11 +527,11 @@ def log_failure(self, log: LsstLogAdapter) -> None:
# put these args in an easier-to-reconstruct equivalent form
# so they can read it more easily and copy and paste into
# a Python terminal.
log.critical(" dimensions=%s,", list(self.query_args["dimensions"].names))
log.critical(" dataId=%s,", dict(self.query_args["dataId"].required))
log.error(" dimensions=%s,", list(self.query_args["dimensions"].names))
log.error(" dataId=%s,", dict(self.query_args["dataId"].required))
if self.query_args["where"]:
log.critical(" where=%s,", repr(self.query_args["where"]))
log.error(" where=%s,", repr(self.query_args["where"]))
if "datasets" in self.query_args:
log.critical(" datasets=%s,", list(self.query_args["datasets"]))
log.error(" datasets=%s,", list(self.query_args["datasets"]))
if "collections" in self.query_args:
log.critical(" collections=%s,", list(self.query_args["collections"]))
log.error(" collections=%s,", list(self.query_args["collections"]))

0 comments on commit 1935541

Please sign in to comment.