Log enhancement

This commit is contained in:
vvzvlad 2025-04-12 00:05:23 +03:00
parent 25dcd27c69
commit a19b22f2c0

View File

@ -286,6 +286,7 @@ if __name__ == "__main__":
# Get initial state from Grist # Get initial state from Grist
initial_sync_count = int(current_vm.Syncs or 0) initial_sync_count = int(current_vm.Syncs or 0)
reboot_count = int(current_vm.Reboots or 0)
# Determine previous status type based on Health string (simplified) # Determine previous status type based on Health string (simplified)
previous_health_status = current_vm.Health or "Idle" previous_health_status = current_vm.Health or "Idle"
previous_status_type = "Idle" # Default previous_status_type = "Idle" # Default
@ -296,7 +297,7 @@ if __name__ == "__main__":
elif previous_health_status.startswith("Error"): elif previous_health_status.startswith("Error"):
previous_status_type = "Error" # Consider error state previous_status_type = "Error" # Consider error state
logger.info(f"Initial state from Grist - Syncs: {initial_sync_count}, Health: {previous_health_status} (interpreted as: {previous_status_type})") logger.info(f"Initial state from Grist - Syncs: {initial_sync_count}, Health: {previous_health_status}, Reboots: {reboot_count}")
for attempt in range(3): for attempt in range(3):
try: try: