From 5edffec06a2140abc74a94fd22aef0f028fa709f Mon Sep 17 00:00:00 2001 From: LePailleurThibault <115649448+LePailleurThibault@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:31:09 +0200 Subject: [PATCH] Repair PrintClient logging system (#268) --- .../wirepas_gateway/dbus_print_client.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/python_transport/wirepas_gateway/dbus_print_client.py b/python_transport/wirepas_gateway/dbus_print_client.py index a5082f98..c80850bf 100644 --- a/python_transport/wirepas_gateway/dbus_print_client.py +++ b/python_transport/wirepas_gateway/dbus_print_client.py @@ -30,10 +30,7 @@ def on_data_received( ): """ logs incoming data from the WM network """ logging.info( - "[%s] Sink %s FROM %d TO %d on EP %d Data Size is %d", - datetime.utcfromtimestamp(int(timestamp / 1000)).strftime( - "%Y-%m-%d %H:%M:%S" - ), + "Sink %s FROM %d TO %d on EP %d Data Size is %d", sink_id, src, dst, @@ -70,15 +67,13 @@ def main(): pass debug_level = "{0}".format(debug_level.upper()) - - # Create a "Print Client" object and enable his logger - obj = PrintClient() logging.basicConfig( - format='%(asctime)s | [%(levelname)s] %(name)s@%(filename)s:%(lineno)d:%(message)s', + format='%(asctime)s | [%(levelname)s] %(message)s', level=debug_level, stream=sys.stdout ) - obj.run() + + PrintClient().run() if __name__ == "__main__":