From d32d419d487dcd9b0fdcd3dc3369d741dd1a41e7 Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Wed, 23 Oct 2024 11:12:05 +0200 Subject: [PATCH] Log when dark storage fails to load response --- src/ert/dark_storage/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ert/dark_storage/common.py b/src/ert/dark_storage/common.py index b5059703acf..3129b16634a 100644 --- a/src/ert/dark_storage/common.py +++ b/src/ert/dark_storage/common.py @@ -1,4 +1,5 @@ import contextlib +import logging from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple from uuid import UUID @@ -11,6 +12,8 @@ from ert.config.field import Field from ert.storage import Ensemble, Experiment, Storage +logger = logging.getLogger(__name__) + response_key_to_displayed_key: Dict[str, Callable[[Tuple[Any, ...]], str]] = { "summary": lambda t: t[0], "gen_data": lambda t: f"{t[0]}@{t[1]}", @@ -153,7 +156,7 @@ def data_for_key( realizations = np.where(mask)[0] data = ensemble.load_responses(response_key, tuple(realizations)) except ValueError as err: - print(f"Could not load response {key}: {err}") + logger.info(f"Dark storage could not load response {key}: {err}") return pd.DataFrame() try: