From 87c5d4814463353b5d039fa8108fb6f9fb9a3d75 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 14:24:53 +0530 Subject: [PATCH] added more logging info --- naxalnet/__init__.py | 2 +- naxalnet/iwd.py | 6 ++++++ naxalnet/scripts.py | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index cc4b311..8e71a68 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -36,4 +36,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.3.0a1.dev3" +__version__ = "0.3.0a1.dev4" diff --git a/naxalnet/iwd.py b/naxalnet/iwd.py index 257adce..b9eb90c 100644 --- a/naxalnet/iwd.py +++ b/naxalnet/iwd.py @@ -270,11 +270,15 @@ class Device: # Stop ap if already started self.stop_ap() + logger.debug( + "Starting ap on %s with ssid %s and password %s", self.name, ssid, passwd + ) self._proxy.Start(ssid, passwd) def stop_ap(self): """stop ap if an ap is started""" if self.is_ap_started(): + logger.debug("Stopping ap on %s", self.name) self._proxy.Stop() self.reload() @@ -305,10 +309,12 @@ class Adapter: def power_on(self): """power on the adapter""" self._proxy.Powered = True + logger.debug("Powered on adapter %s", self.name) def power_off(self): """power off the adapter""" self._proxy.Powered = False + logger.debug("Powered off adapter %s", self.name) def supports_mode(self, mode: str) -> bool: """ diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index 11e0de9..ce2d268 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -116,6 +116,9 @@ def setup_devices(args): ap_adapter.reload() ap_device.start_ap(args.ap_ssid, args.ap_passwd) + # naxalnet prints Bye if no errors occured + logger.info("Bye") + def print_wifi(args): """