Commit d01f10c5 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Improved logging in main code

parent c7f3419c
Pipeline #30243 passed with stage
in 2 minutes and 53 seconds
......@@ -75,19 +75,21 @@ def main():
aem_source_id,
)
print("Name of the model: %s" % (aem.model_name))
print("Format: %s" % (aem.exposure_format))
logger.info("Name of the model: %s" % (aem.model_name))
logger.info("Format: %s" % (aem.exposure_format))
if aem.occupancy_cases is not None:
print("Occupancy cases: %s" % (", ".join(aem.occupancy_cases)))
logger.info("Available occupancy cases: %s" % (", ".join(aem.occupancy_cases)))
print("Data retrieved:")
for exposure_entity in aem.exposure_entities.keys():
print(" %s (%s):" % (exposure_entity, aem.exposure_entities[exposure_entity].code))
logger.info("Data retrieved:")
for exposure_entity in config.exposure_entities_to_run:
logger.info(
" %s (%s):" % (exposure_entity, aem.exposure_entities[exposure_entity].code)
)
for case in aem.exposure_entities[exposure_entity].occupancy_cases.keys():
print(" %s:" % case)
logger.info(" %s:" % case)
for attr in ["data_units_type", "data_units_level", "data_units_definition"]:
print(
" %s: %s"
logger.info(
" %s: %s"
% (
attr,
aem.exposure_entities[exposure_entity].occupancy_cases[case][attr],
......@@ -102,7 +104,7 @@ def main():
)
> 0
):
print(" data_units names: retrieved")
logger.info(" data_units names: retrieved")
geometries_retrieved = True
for data_unit_id in aem.exposure_entities[exposure_entity].occupancy_cases[
case
......@@ -116,15 +118,15 @@ def main():
geometries_retrieved = False
break
if geometries_retrieved:
print(" data_units geometries: retrieved")
logger.info(" data_units geometries: retrieved")
else:
print(" data_units geometries: not retrieved")
logger.info(" data_units geometries: not retrieved")
else:
print(" data_units names: not retrieved")
print(" data_units geometries: not retrieved")
logger.info(" data_units names: not retrieved")
logger.info(" data_units geometries: not retrieved")
else:
print(" data_units names: not retrieved")
print(" data_units geometries: not retrieved")
logger.info(" data_units names: not retrieved")
logger.info(" data_units geometries: not retrieved")
# Leave the program
logger.info("gde-importer has finished")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment