Skip to content
Snippets Groups Projects
Commit fac1ceb5 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added new logging settings for the ParserInterface class.

parent 4596a16f
Branches
Tags
No related merge requests found
......@@ -38,7 +38,7 @@ class ParserInterface(with_metaclass(ABCMeta, object)):
"""
metainfo_env = None
def __init__(self, main_file, metainfo_to_keep=None, backend=None, default_units=None, metainfo_units=None, debug=True, store=True):
def __init__(self, main_file, metainfo_to_keep=None, backend=None, default_units=None, metainfo_units=None, debug=False, log_level=logging.ERROR, store=True):
"""
Args:
main_file: A special file that can be considered the main file of the
......@@ -50,6 +50,7 @@ class ParserInterface(with_metaclass(ABCMeta, object)):
The backend will then determine where and when to output that data.
"""
self.debug = debug
logger.setLevel(log_level)
self.store = store
self.initialize(main_file, metainfo_to_keep, backend, default_units, metainfo_units)
......@@ -258,7 +259,7 @@ class FileService(object):
# Check that the file exists
path = os.path.join(self.root_folder, path)
if not os.path.isfile(path):
logger.error("Could not set the id for file '{}' as it cannot be found.".format(path))
logger.warning("Could not set the id for file '{}' as it cannot be found.".format(path))
return None
else:
self.map_id_to_path[file_id] = path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment