update condizione di LOG
This commit is contained in:
@@ -27,11 +27,16 @@ import logging
|
||||
import logging.handlers
|
||||
import threading
|
||||
import configparser
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from array import array
|
||||
|
||||
import redis
|
||||
import requests
|
||||
import urllib3
|
||||
|
||||
# Disable urllib3 debug logging to keep application logs clean
|
||||
urllib3.disable_warnings()
|
||||
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||
|
||||
# Note: RPi.GPIO is imported inside the class or at runtime to prevent errors on non-Pi systems
|
||||
try:
|
||||
@@ -232,7 +237,7 @@ class ReadParallelaIOB:
|
||||
|
||||
def accoda(self, value):
|
||||
try:
|
||||
dt_eve = datetime.utcnow().strftime('%Y%m%d%H%M%S%f')[:-3]
|
||||
dt_eve = datetime.now(timezone.utc).strftime('%Y%m%d%H%M%S%f')[:-3]
|
||||
self.rqEnqueue(f"{dt_eve}#{value}#{self.cont}")
|
||||
except Exception as e:
|
||||
self.logPro.error(f"QUEUE ERROR: {e}")
|
||||
@@ -272,7 +277,7 @@ class ReadParallelaIOB:
|
||||
|
||||
parts = resp.split("#")
|
||||
dt_eve, val, cnt = parts[0], parts[1], parts[2]
|
||||
dt_curr = datetime.utcnow().strftime('%Y%m%d%H%M%S%f')[:-3]
|
||||
dt_curr = datetime.now(timezone.utc).strftime('%Y%m%d%H%M%S%f')[:-3]
|
||||
|
||||
url = f"{self.URLBASE}{self.idxMacchina}{self.URLADV1}{val}&dtCurr={dt_curr}&dtEve={dt_eve}&cnt={cnt}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user