Skip to content

Commit

Permalink
Added logging for PS
Browse files Browse the repository at this point in the history
  • Loading branch information
OSINT-TECHNOLOGIES authored Aug 21, 2024
1 parent 0274685 commit 3ba5ac4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions service/logs_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ def create_log_folder():
os.makedirs(scan_logs_folder, exist_ok=True)
return scan_logs_folder

def write_logs(ctime, whois_gather_status, contact_mail_gather_status, subdomains_gather_status, list_to_log, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status):
def write_logs(ctime, whois_gather_status, contact_mail_gather_status, subdomains_gather_status, list_to_log, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status, ps_to_log_list):
to_log = [whois_gather_status, contact_mail_gather_status, subdomains_gather_status, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status]
subdomains_processes_logs = [item for sublist in list_to_log for item in sublist]
scan_logs_folder = create_log_folder()
log_file_name = f"scan_log_{ctime}.log"
logging.basicConfig(level=logging.INFO, filename=scan_logs_folder + "// " + log_file_name, filemode="w", format="%(asctime)s %(message)s")
logging.info("# THIS FILE REPRESENTS DPULSE SCAN LOGS\n")
print(Fore.GREEN + "Created log file for this scan" + Style.RESET_ALL)
print(Fore.GREEN + f"Created {log_file_name} log file for this scan" + Style.RESET_ALL)

for log in to_log:
logging.info(log)

for log in subdomains_processes_logs:
logging.info(log)

for log in ps_to_log_list:
logging.info(log)

logging.shutdown()
return log_file_name

0 comments on commit 3ba5ac4

Please sign in to comment.