From e54c580ccef263559964e613f73c6234efe8b6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 3 Oct 2024 11:01:56 +0200 Subject: [PATCH] chg: improve logging messages --- lookyloo/capturecache.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lookyloo/capturecache.py b/lookyloo/capturecache.py index 6084f505..044a65e6 100644 --- a/lookyloo/capturecache.py +++ b/lookyloo/capturecache.py @@ -586,13 +586,13 @@ class CapturesIndex(Mapping): # type: ignore[type-arg] try: a_response = await self.dnsresolver.resolve(node.name, dns.rdatatype.RdataType.A, search=True, raise_on_no_answer=False) except Exception as e: - logger.info(f'[A record] Unable to resolve DNS: {e}') + logger.info(f'[A record] Unable to resolve: {e}') a_response = None try: aaaa_response = await self.dnsresolver.resolve(node.name, dns.rdatatype.RdataType.AAAA, search=True, raise_on_no_answer=False) except Exception as e: - logger.info(f'[AAAA record] Unable to resolve DNS: {e}') + logger.info(f'[AAAA record] Unable to resolve: {e}') aaaa_response = None if a_response is None and aaaa_response is None: @@ -630,7 +630,7 @@ class CapturesIndex(Mapping): # type: ignore[type-arg] # Should only have one break except Exception as e: - logger.warning(f'[SOA record] Unable to resolve DNS: {e}') + logger.warning(f'[SOA record] Unable to resolve: {e}') # NS, and MX records that may not be in the response for the hostname # trigger the request on domains if needed. @@ -645,10 +645,10 @@ class CapturesIndex(Mapping): # type: ignore[type-arg] logger.debug(f'No MX record for {domain}.') mx_response = None except Exception as e: - logger.warning(f'[MX record] Unable to resolve DNS: {e}') + logger.warning(f'[MX record] Unable to resolve: {e}') mx_response = None except Exception as e: - logger.warning(f'[MX record] Unable to resolve DNS: {e}') + logger.warning(f'[MX record] Unable to resolve: {e}') mx_response = None if mx_response: @@ -684,10 +684,11 @@ class CapturesIndex(Mapping): # type: ignore[type-arg] to_query = to_query[to_query.index('.') + 1:] continue except Exception as e: - logger.warning(f'[NS record] Unable to resolve DNS: {e}') + logger.warning(f'[NS record] Unable to resolve: {e}') ns_response = None + break except Exception as e: - logger.warning(f'[NS record] Unable to resolve DNS: {e}') + logger.warning(f'[NS record] Unable to resolve: {e}') ns_response = None if ns_response: