SIENTIAPDE-1110
Refactor logging in OpcRepository to consistently use 'schedule_name' from metadata for improved error reporting and traceability.
This commit is contained in:
@@ -217,7 +217,7 @@ class OpcRepository():
|
||||
level=NotificationLevel.ERROR,
|
||||
attachment_content=trace
|
||||
)
|
||||
logger.custom_error(trace, metadata)
|
||||
logger.custom_error(trace, metadata.get('schedule_name', 'N/A'))
|
||||
self.error_count += 1
|
||||
return False
|
||||
|
||||
@@ -232,7 +232,7 @@ class OpcRepository():
|
||||
|
||||
data = data_type_map[data_type]['converter'](value)
|
||||
logger.custom_info(
|
||||
f'Writing {data} - {type(data)} to {node}', metadata)
|
||||
f'Writing {data} - {type(data)} to {node}', metadata.get('schedule_name', 'N/A'))
|
||||
ua_data = DataValue(
|
||||
Variant(data, data_type_map[data_type]['opc_type']))
|
||||
|
||||
@@ -247,7 +247,7 @@ class OpcRepository():
|
||||
level=NotificationLevel.ERROR,
|
||||
attachment_content=trace
|
||||
)
|
||||
logger.custom_error(trace, metadata)
|
||||
logger.custom_error(trace, metadata.get('schedule_name', 'N/A'))
|
||||
self.error_count += 1
|
||||
return False
|
||||
self.error_count = 0
|
||||
|
||||
Reference in New Issue
Block a user