]> www.average.org Git - loctrkd.git/blobdiff - gps303/collector.py
Don't make unneeded responses, better debug log
[loctrkd.git] / gps303 / collector.py
index 921833c083be0ac8aecda838a338a4f72b5f818c..8bcca303a627e75b9220fa89d0cdf5f81f761357 100644 (file)
@@ -100,6 +100,7 @@ class Clients:
 
     def add(self, clntsock, clntaddr):
         fd = clntsock.fileno()
+        log.info("Start serving fd %d from %s", fd, clntaddr)
         self.by_fd[fd] = Client(clntsock, clntaddr)
         return fd
 
@@ -121,6 +122,12 @@ class Clients:
             if proto_of_message(packet) == LOGIN.PROTO:  # Could do blindly...
                 self.by_imei[clnt.imei] = clnt
             result.append((clnt.imei, when, peeraddr, packet))
+            log.debug(
+                "Received from %s (IMEI %s): %s",
+                peeraddr,
+                clnt.imei,
+                packet.hex(),
+            )
         return result
 
     def response(self, resp):