Skip to content

Commit

Permalink
Uplink/downlink traffic debug verbosity (#167)
Browse files Browse the repository at this point in the history
* Make log clear between uplink and downlink
* Add event id to help the debug

Co-authored-by: Gwendal <[email protected]>
  • Loading branch information
PFigs and GwendalRaoul committed Jan 17, 2020
1 parent af3b3ea commit 0063810
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python_transport/wirepas_gateway/transport_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def on_data_received(
topic = TopicGenerator.make_received_data_topic(
self.gw_id, sink_id, network_address, src_ep, dst_ep
)
self.logger.debug("Sending data to: %s", topic)
self.logger.debug("Uplink traffic: %s | %s", topic, event.event_id)

# Set qos to 1 to avoid loading too much the broker
# unique id in event header can be used for duplicate filtering in
# backends
Expand Down Expand Up @@ -421,7 +422,6 @@ def on_sink_disconnected(self, name):
@deferred_thread
def _on_send_data_cmd_received(self, client, userdata, message):
# pylint: disable=unused-argument
self.logger.info("Request to send data")
try:
request = wirepas_messaging.gateway.api.SendDataRequest.from_payload(
message.payload
Expand All @@ -433,7 +433,7 @@ def _on_send_data_cmd_received(self, client, userdata, message):
# Get the sink-id from topic
_, sink_id = TopicParser.parse_send_data_topic(message.topic)

self.logger.debug("Request for sink %s", sink_id)
self.logger.debug("Downlink traffic: %s | %s", sink_id, request.req_id)

sink = self.sink_manager.get_sink(sink_id)
if sink is not None:
Expand Down

0 comments on commit 0063810

Please sign in to comment.