From 8012ff778c6edae14383c0898d0456e039368a61 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 19 Aug 2025 11:52:42 -0300 Subject: [PATCH] SIENTIAPDE-1199 Refactor logging in OpcRepository to include full metadata in error and info messages - Updated logging statements in the OpcRepository class to pass the complete metadata object instead of just the schedule name, enhancing the context available for debugging and monitoring. --- laborious/utils/repository/opc_repository.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laborious/utils/repository/opc_repository.py b/laborious/utils/repository/opc_repository.py index f2e8b75..91bdd8f 100644 --- a/laborious/utils/repository/opc_repository.py +++ b/laborious/utils/repository/opc_repository.py @@ -250,7 +250,7 @@ class OpcRepository(): data = data_type_map[data_type]['converter'](value) logger.custom_info( - f'Writing {data} - {type(data)} to {node}', metadata.get('schedule_name', 'N/A')) + f'Writing {data} - {type(data)} to {node}', metadata) now = datetime.now() ua_data = DataValue( Variant(data, data_type_map[data_type]['opc_type']), @@ -286,7 +286,7 @@ class OpcRepository(): except Exception as e: trace = traceback.format_exc() - logger.custom_error(trace, metadata.get('schedule_name', 'N/A')) + logger.custom_error(trace, metadata) self.error_count += 1 return False, { "notification_id": f"OPC_WRITE_DATA_ERROR_{self.id}",