new: integrated python standard logger (closes #84)

This commit is contained in:
Simone Margaritelli
2019-10-03 17:06:40 +02:00
parent 335e6b1311
commit 4cf2866737
19 changed files with 171 additions and 173 deletions

View File

@ -202,14 +202,14 @@ running = False
def on_loaded():
core.log("GPS plugin loaded for %s" % device)
logging.info("GPS plugin loaded for %s" % device)
def on_ready(agent):
global running
if os.path.exists(device):
core.log("enabling GPS bettercap's module for %s" % device)
logging.info("enabling GPS bettercap's module for %s" % device)
try:
agent.run('gps off')
except:
@ -220,7 +220,7 @@ def on_ready(agent):
agent.run('gps on')
running = True
else:
core.log("no GPS detected")
logging.info("no GPS detected")
def on_handshake(agent, filename, access_point, client_station):
@ -229,7 +229,7 @@ def on_handshake(agent, filename, access_point, client_station):
gps = info['gps']
gps_filename = filename.replace('.pcap', '.gps.json')
core.log("saving GPS to %s (%s)" % (gps_filename, gps))
logging.info("saving GPS to %s (%s)" % (gps_filename, gps))
with open(gps_filename, 'w+t') as fp:
json.dump(gps, fp)
```