Skip to content

Commit

Permalink
chore(doip-discover): Small improvments on the logging side
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdinandjarisch authored and rumpelsepp committed Dec 4, 2024
1 parent c43cb63 commit b3f5a85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/gallia/commands/discover/doip.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ async def enumerate_target_addresses(
req = TesterPresentRequest(suppress_response=False)
await conn.write_diag_request(req.pdu)

# If we reach this, the request was not denied due to unknown TargetAddress
# If we reach this, the request was not denied due to unknown TargetAddress or other DoIP errors
known_targets.append(current_target)
logger.notice(f"[🥇] HEUREKA: target address {target_addr:#x} is valid! ")
logger.notice(f"[🥈] HEUREKA: target address {target_addr:#x} is valid! ")
async with aiofiles.open(
self.artifacts_dir.joinpath("3_valid_targets.txt"), "a"
) as f:
Expand Down Expand Up @@ -427,8 +427,11 @@ async def enumerate_target_addresses(
logger.notice(
f"[⚔️] It's dangerous to test alone, take one of these {len(known_targets)} known targets:"
)
for item in known_targets:
logger.notice(item)
if len(known_targets) > 100:
logger.notice("[💯] Too many to print, check the artifacts instead!")
else:
for item in known_targets:
logger.notice(item)

logger.notice(
f"[❓] Those {len(unreachable_targets)} targets were unreachable by the gateway (could be just temporary):"
Expand Down

0 comments on commit b3f5a85

Please sign in to comment.