Skip to content

Commit

Permalink
bugfix: logging typos and levels
Browse files Browse the repository at this point in the history
  • Loading branch information
martynas.karobcikas committed Oct 14, 2024
1 parent b98d033 commit bfa5fff
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions emf/loadflow_tool/model_merger/model_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def handle(self, task_object: dict, **kwargs):
if pre_temp_fixes:
input_models = run_pre_merge_processing(input_models, merging_area)
pre_p_end = datetime.datetime.now(datetime.UTC)
logger.error(f"Pre-processing took: {(pre_p_end - pre_p_start).total_seconds()} seconds")
logger.debug(f"Pre-processing took: {(pre_p_end - pre_p_start).total_seconds()} seconds")

# Load network model and merge
merge_start = datetime.datetime.now(datetime.UTC)
Expand All @@ -205,8 +205,8 @@ def handle(self, task_object: dict, **kwargs):
# Package both input models and exported CGM profiles to in memory zip files
serialized_data = merge_functions.export_to_cgmes_zip([ssh_data, sv_data])
post_p_end = datetime.datetime.now(datetime.UTC)
logger.error(f"Post proocessing took: {(post_p_end - post_p_start).total_seconds()} seconds")
logger.error(f"Merging took: {(merge_end - merge_start).total_seconds()} seconds")
logger.debug(f"Post proocessing took: {(post_p_end - post_p_start).total_seconds()} seconds")
logger.debug(f"Merging took: {(merge_end - merge_start).total_seconds()} seconds")

# Upload to OPDM
if model_upload_to_opdm:
Expand Down Expand Up @@ -275,6 +275,7 @@ def handle(self, task_object: dict, **kwargs):

# Send merge report to Elastic
if model_merge_report_send_to_elk:
logger.info(f"Sending merge report to Elastic")
try:
merge_report = merge_functions.generate_merge_report(solved_model, valid_models, merge_log)
try:
Expand All @@ -288,7 +289,7 @@ def handle(self, task_object: dict, **kwargs):
# Stop Trace
self.elk_logging_handler.stop_trace()

logger.info(f"Merge task finished for model: '{cgm_name}'")
logger.info(f"Merge task finished for model: {cgm_name}")

return task

Expand Down Expand Up @@ -331,7 +332,7 @@ def handle(self, task_object: dict, **kwargs):
"job_period_start": "2024-05-24T22:00:00+00:00",
"job_period_end": "2024-05-25T06:00:00+00:00",
"task_properties": {
"timestamp_utc": "2024-10-11T06:30:00+00:00",
"timestamp_utc": "2024-10-14T06:30:00+00:00",
"merge_type": "EU",
"merging_entity": "BALTICRSC",
"included": ['PSE', 'AST'],
Expand All @@ -346,7 +347,7 @@ def handle(self, task_object: dict, **kwargs):
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "False",
"send_merge_report": "False",
"send_merge_report": "True",
}
}

Expand Down

0 comments on commit bfa5fff

Please sign in to comment.