diff --git a/agent/src/main.py b/agent/src/main.py index 65380af..db81260 100644 --- a/agent/src/main.py +++ b/agent/src/main.py @@ -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}")