Skip to content

Commit

Permalink
use pynxtools logger, and consistently use this logger
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Jul 26, 2024
1 parent 740fc35 commit 5c25635
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pynxtools_mpes/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

from pynxtools_mpes.mappings import CONVERT_DICT, DEFAULT_UNITS, REPLACE_NESTED

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger = logging.getLogger("pynxtools")


def recursive_parse_metadata(
Expand Down Expand Up @@ -228,7 +227,7 @@ def handle_objects(self, objects: Tuple[Any]) -> Dict[str, Any]:
self.data_xarray = objects[0]
return {}

logging.info(
logger.info(
f"Error while reading objects: {objects} does not contain an xarray object."
" Skipping the objects."
)
Expand All @@ -242,10 +241,10 @@ def get_data(self, key: str, path: str) -> Any:
return value

except ValueError:
print(f"Incorrect axis name corresponding to the path {path}")
logger.warning(f"Incorrect axis name corresponding to the path {path}")

except AttributeError:
print(
logger.warning(
"Incorrect naming syntax or the xarray doesn't "
f"contain entry corresponding to the path {path}"
)
Expand All @@ -257,7 +256,7 @@ def get_attr(self, key: str, path: str) -> Any:
try:
return iterate_dictionary(self.data_xarray.attrs, path)
except KeyError:
logging.info(f"Path {path} not found. Skipping the entry.")
logger.info(f"Path {path} not found. Skipping the entry.")


READER = MPESReader

0 comments on commit 5c25635

Please sign in to comment.