Skip to content

Commit

Permalink
airport: fix logger
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Oct 24, 2023
1 parent cd47e2e commit 6e4793f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions automon/integrations/mac/airport/airport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,7 +21,8 @@

}

log = Logging(name='Airport', level=Logging.DEBUG)
log = logger.logging.getLogger(__name__)
log.setLevel(logger.DEBUG)


class Airport:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
7 changes: 4 additions & 3 deletions automon/integrations/mac/airport/scan.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions automon/integrations/mac/airport/ssid.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 6e4793f

Please sign in to comment.