diff --git a/automon/integrations/mac/airport/airport.py b/automon/integrations/mac/airport/airport.py index 1501e1b4..18f8ae72 100644 --- a/automon/integrations/mac/airport/airport.py +++ b/automon/integrations/mac/airport/airport.py @@ -3,7 +3,7 @@ from bs4 import BeautifulSoup -from automon.log import Logging +from automon.log import logger from automon.helpers import Run from automon.helpers import Dates @@ -21,7 +21,8 @@ } -log = Logging(name='Airport', level=Logging.DEBUG) +log = logger.logging.getLogger(__name__) +log.setLevel(logger.DEBUG) class Airport: @@ -114,7 +115,8 @@ def run(self, args: str = None): self._scan_output = self._runner.stdout return True except Exception as e: - log.error(e, raise_exception=True) + log.error(e) + raise (Exception(e)) return False @@ -179,6 +181,6 @@ def scan_xml(self, ssid: str = None, channel: int = None) -> [Ssid]: return True except Exception as e: - log.error(f'Scan not parsed: {e}, {self.scan_cmd}', enable_traceback=False) + log.error(f'Scan not parsed: {e}, {self.scan_cmd}') return False diff --git a/automon/integrations/mac/airport/scan.py b/automon/integrations/mac/airport/scan.py index d15ef6d8..33eb56f1 100644 --- a/automon/integrations/mac/airport/scan.py +++ b/automon/integrations/mac/airport/scan.py @@ -1,10 +1,11 @@ from bs4 import BeautifulSoup -from automon.log import Logging +from automon.log import logger from .ssid import Ssid -log = Logging(name='ScanXml', level=Logging.DEBUG) +log = logger.logging.getLogger(__name__) +log.setLevel(logger.DEBUG) class ScanXml: @@ -74,7 +75,7 @@ def ssids(self) -> [Ssid]: bssids = xml.contents[1].contents[0].contents scan = [self._bs2dict(x) for x in bssids] except: - log.error(f'No BSSIDs', enable_traceback=False) + log.error(f'No BSSIDs') if scan: ssids = [Ssid(ssid) for ssid in scan] diff --git a/automon/integrations/mac/airport/ssid.py b/automon/integrations/mac/airport/ssid.py index 99194661..41a7832d 100644 --- a/automon/integrations/mac/airport/ssid.py +++ b/automon/integrations/mac/airport/ssid.py @@ -1,6 +1,7 @@ -from automon.log import Logging +from automon.log import logger -log = Logging(name='Ssid', level=Logging.DEBUG) +log = logger.logging.getLogger(__name__) +log.setLevel(logger.DEBUG) class Ssid: