SCRUM-80
Changed print to logging in agent main
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from paho.mqtt import client as mqtt_client
|
||||
from schema.aggregated_data_schema import AggregatedDataSchema
|
||||
from file_datasource import FileDatasource
|
||||
import logging
|
||||
import config
|
||||
|
||||
|
||||
@@ -28,7 +29,7 @@ def publish(client, topic, datasource):
|
||||
data = datasource.read()
|
||||
msg = AggregatedDataSchema().dumps(data)
|
||||
result = client.publish(topic, msg)
|
||||
print(f"Published to {topic}: {msg[:50]}...")
|
||||
logging.info(f"Published to {topic}: {msg[:50]}...")
|
||||
status = result[0]
|
||||
if status != 0:
|
||||
print(f"Failed to send message to topic {topic}")
|
||||
|
||||
Reference in New Issue
Block a user