Skip to content

Commit

Permalink
Changes loglevels to info
Browse files Browse the repository at this point in the history
  • Loading branch information
sherjeelshabih committed Jan 17, 2024
1 parent 23ab1fb commit c90f3da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pynxtools/dataconverter/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from pynxtools.nexus import nexus

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)

if sys.version_info >= (3, 10):
from importlib.metadata import entry_points
Expand Down
2 changes: 1 addition & 1 deletion pynxtools/dataconverter/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from pynxtools.nexus.nexus import NxdlAttributeError

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)


def is_a_lone_group(xml_element) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion pynxtools/dataconverter/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from pynxtools.dataconverter.exceptions import InvalidDictProvided

logger = logging.getLogger(__name__) # pylint: disable=C0103
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)


def does_path_exist(path, h5py_obj) -> bool:
Expand Down
7 changes: 3 additions & 4 deletions tests/dataconverter/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from setuptools import distutils

from pynxtools.dataconverter import helpers
from pynxtools.dataconverter.logger import logger as pynx_logger
from pynxtools.dataconverter.template import Template


Expand Down Expand Up @@ -394,7 +393,7 @@ def test_validate_data_dict(
"link-dict-instead-of-bool",
"opt-group-completely-removed",
):
helpers.validate_data_dict(template, data_dict, nxdl_root, logger=pynx_logger)
helpers.validate_data_dict(template, data_dict, nxdl_root)
# Missing required fields caught by logger with warning
elif request.node.callspec.id in (
"empty-required-field",
Expand All @@ -406,11 +405,11 @@ def test_validate_data_dict(
assert "" == caplog.text
# logger records
captured_logs = caplog.records
helpers.validate_data_dict(template, data_dict, nxdl_root, pynx_logger)
helpers.validate_data_dict(template, data_dict, nxdl_root)
assert any(error_message in rec.message for rec in captured_logs)
else:
with pytest.raises(Exception) as execinfo:
helpers.validate_data_dict(template, data_dict, nxdl_root, pynx_logger)
helpers.validate_data_dict(template, data_dict, nxdl_root)
assert (error_message) == str(execinfo.value)


Expand Down

0 comments on commit c90f3da

Please sign in to comment.