From 1935541a7bf5257b733e76637472d200fbda28db Mon Sep 17 00:00:00 2001 From: Krzysztof Findeisen Date: Tue, 27 Aug 2024 11:35:41 -0700 Subject: [PATCH] Demote initial ID query explanation to error. 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. --- doc/changes/DM-45722.other.md | 1 + .../all_dimensions_quantum_graph_builder.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 doc/changes/DM-45722.other.md diff --git a/doc/changes/DM-45722.other.md b/doc/changes/DM-45722.other.md new file mode 100644 index 000000000..c66b066b9 --- /dev/null +++ b/doc/changes/DM-45722.other.md @@ -0,0 +1 @@ +Explanatory logs for "initial data ID query returned no rows" are now reported at ERROR, not CRITICAL, level. diff --git a/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py b/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py index 2ef427315..8c0eb81d3 100644 --- a/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py +++ b/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py @@ -507,7 +507,7 @@ 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 @@ -515,10 +515,10 @@ def log_failure(self, log: LsstLogAdapter) -> None: 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:" ) @@ -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"]))