MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / log_result

Method log_result

nmap_logger.py:57–74  ·  view source on GitHub ↗

Log the result of an nmap command

(self, stdout: str, stderr: str, returncode: int, context: str = "")

Source from the content-addressed store, hash-verified

55 self.logger.info(f"COMMAND{context_str}: {command_str}")
56
57 def log_result(self, stdout: str, stderr: str, returncode: int, context: str = ""):
58 """Log the result of an nmap command"""
59 with self.lock:
60 context_str = f" ({context})" if context else ""
61
62 self.logger.info(f"RESULT{context_str}: Return code: {returncode}")
63
64 if stdout:
65 self.logger.info(f"STDOUT{context_str}:")
66 for line in stdout.strip().split('\n'):
67 if line.strip():
68 self.logger.info(f" {line}")
69
70 if stderr:
71 self.logger.warning(f"STDERR{context_str}:")
72 for line in stderr.strip().split('\n'):
73 if line.strip():
74 self.logger.warning(f" {line}")
75
76 def log_scan_operation(self, operation: str, details: str = ""):
77 """Log a general nmap scan operation"""

Callers 1

run_nmap_commandMethod · 0.95

Calls 2

infoMethod · 0.80
warningMethod · 0.80

Tested by

no test coverage detected