From d20f6c8a52c598b13c035f26a187c542f23487fa Mon Sep 17 00:00:00 2001 From: Simone Margaritelli <evilsocket@gmail.com> Date: Wed, 23 Oct 2019 19:28:05 +0200 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- pwnagotchi/plugins/default/grid.py | 2 +- pwnagotchi/utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/grid.py b/pwnagotchi/plugins/default/grid.py index 5b32635..d111f9a 100644 --- a/pwnagotchi/plugins/default/grid.py +++ b/pwnagotchi/plugins/default/grid.py @@ -135,4 +135,4 @@ def on_internet_available(agent): logging.debug("grid: reporting disabled") except Exception as e: - logging.error("grid api: %s" % e) + logging.error("grid api: %s" % e) \ No newline at end of file diff --git a/pwnagotchi/utils.py b/pwnagotchi/utils.py index ab7acfd..8532ae4 100644 --- a/pwnagotchi/utils.py +++ b/pwnagotchi/utils.py @@ -108,7 +108,10 @@ def setup_logging(args, config): console_handler = logging.StreamHandler() console_handler.setFormatter(formatter) root.addHandler(console_handler) - + # https://stackoverflow.com/questions/24344045/how-can-i-completely-remove-any-logging-from-requests-module-in-python?noredirect=1&lq=1 + requests_log = logging.getLogger("requests") + requests_log.addHandler(logging.NullHandler()) + requests_log.propagate = False def secs_to_hhmmss(secs): mins, secs = divmod(secs, 60)