SIENTIAPDE-1199

Refactor logging levels in Ingestor and IngestorManager for improved clarity

- Changed debug log statements to info level in Ingestor class for better visibility of subscription and management actions.
- Updated log level for initializing OPC manager in IngestorManager to info for consistent logging practices.
This commit is contained in:
vitor-aignosi
2025-08-20 12:20:15 -03:00
parent a19ec20c12
commit f90a261d7c
2 changed files with 9 additions and 9 deletions

View File

@@ -248,18 +248,18 @@ class Ingestor:
for slot, config in new_managed_tags.items(): for slot, config in new_managed_tags.items():
if slot not in old_managed_tags: if slot not in old_managed_tags:
self.logger.debug(f"Subscribing to new slot {slot}") self.logger.info(f"Subscribing to new slot {slot}")
self.ingestor_manager.subscribe_to_tags({slot: config}) self.ingestor_manager.subscribe_to_tags({slot: config})
continue continue
if config != old_managed_tags[slot]: if config != old_managed_tags[slot]:
self.logger.debug(f"Resubscribing to slot {slot}") self.logger.info(f"Resubscribing to slot {slot}")
self.ingestor_manager.unsubscribe_slot(slot) self.ingestor_manager.unsubscribe_slot(slot)
self.ingestor_manager.subscribe_to_tags({slot: config}) self.ingestor_manager.subscribe_to_tags({slot: config})
for slot in old_managed_tags.keys(): for slot in old_managed_tags.keys():
if slot not in new_managed_tags: if slot not in new_managed_tags:
self.logger.debug(f"Unsubscribing from slot {slot}") self.logger.info(f"Unsubscribing from slot {slot}")
self.ingestor_manager.unsubscribe_slot(slot) self.ingestor_manager.unsubscribe_slot(slot)
# Ensure the gauge is updated after any potential changes here # Ensure the gauge is updated after any potential changes here
@@ -302,14 +302,14 @@ class Ingestor:
metrics.ACTIVE_INGESTORS.set(number_of_ingestors) metrics.ACTIVE_INGESTORS.set(number_of_ingestors)
# Handle no slots # Handle no slots
self.logger.debug("Managing no slots...") self.logger.info("Managing no slots...")
self.manage_no_slots(number_of_slots) self.manage_no_slots(number_of_slots)
available_slots = number_of_slots - number_of_leases available_slots = number_of_slots - number_of_leases
lacking_ingestors = number_of_slots - number_of_ingestors lacking_ingestors = number_of_slots - number_of_ingestors
slot_diff = len(self.ingestor_manager.managed_tags) - 1 slot_diff = len(self.ingestor_manager.managed_tags) - 1
self.logger.debug("Managing leases...") self.logger.info("Managing leases...")
self.manage_leases(available_slots, lacking_ingestors, slot_diff) self.manage_leases(available_slots, lacking_ingestors, slot_diff)
# Update managed slots gauge # Update managed slots gauge
@@ -329,12 +329,12 @@ class Ingestor:
self.logger.info("No slots acquired in this loop") self.logger.info("No slots acquired in this loop")
# Update opc servers # Update opc servers
self.logger.debug("Updating slot config...") self.logger.info("Updating slot config...")
self.ingestor_manager.update_slot_config() self.ingestor_manager.update_slot_config()
# Check OPC cycles # Check OPC cycles
self.logger.debug("Checking OPC servers integrity...") self.logger.info("Checking OPC servers integrity...")
self.ingestor_manager.check_opc_servers_integrity() self.ingestor_manager.check_opc_servers_integrity()
self.logger.debug("Updating managed tags...") self.logger.info("Updating managed tags...")
self.update_ingestor_manager(current_managed_tags) self.update_ingestor_manager(current_managed_tags)

View File

@@ -153,7 +153,7 @@ class IngestorManager(BaseActivity):
server_config.pop('tags', None) server_config.pop('tags', None)
server_instance = self.opc_managers.get(server, None) server_instance = self.opc_managers.get(server, None)
if server_instance is None: if server_instance is None:
self.logger.debug( self.logger.info(
f"Initializing OPC manager for server {server}" f"Initializing OPC manager for server {server}"
) )
server_instance = self.initialize_opc_from_config( server_instance = self.initialize_opc_from_config(