Skip to content

feat: add --verbose flag and improve error messaging#35

Open
quanticsoul4772 wants to merge 1 commit intoSolDevelo:mainfrom
quanticsoul4772:rawcell/add-verbose-flag
Open

feat: add --verbose flag and improve error messaging#35
quanticsoul4772 wants to merge 1 commit intoSolDevelo:mainfrom
quanticsoul4772:rawcell/add-verbose-flag

Conversation

@quanticsoul4772
Copy link
Copy Markdown

Summary

Addresses #32 — InfraScan should be more verbose.

  • New -v / --verbose flag — sets logging to DEBUG level and enables richer output
  • Verbose startup info — prints resolved framework, output format, and --download-external-modules state before scanning
  • Verbose scan summary — prints resource count and finding count as soon as the scanner finishes
  • Better error messages — regular path now shows [ERROR] Scan failed: <reason> + a hint to rerun with --verbose for the full traceback (previously required setting DEBUG externally)
  • Consistent prefix style[ERROR], [INFO], [*] prefixes make log lines easier to grep in CI output

Example output

Normal run:

[*] Scanning '/path/to/infra' with scanner: 'comprehensive' ...

Verbose run:

[*] Scanning '/path/to/infra' with scanner: 'comprehensive' ...
[*] Framework: auto
[*] Output format: text
[*] Download external modules: False
[*] Scan complete: 12 resource(s) found, 3 finding(s)

Error (normal):

[ERROR] Scan failed: <message>
[INFO]  Run with --verbose (-v) for a full traceback and debug output.

Error (verbose):

[ERROR] Scan failed: <message>
[INFO]  Run with --verbose (-v) for a full traceback and debug output.
Traceback (most recent call last):
  ...

🤖 Generated with Claude Code

Addresses SolDevelo#32 - InfraScan should be more verbose.

Changes:
- Add -v / --verbose CLI flag that sets logging to DEBUG level
- Verbose mode prints framework, format, and module settings at startup
- Verbose mode reports resource count and finding count after scan completes
- Verbose mode shows full traceback on exception (previously required DEBUG
  log level to be set externally)
- Regular error path now prints a hint to run with --verbose for more detail
- Improve error message prefixes: [ERROR], [INFO], [*] for clarity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jkondrat
Copy link
Copy Markdown
Collaborator

jkondrat commented Apr 13, 2026

This doesn't fully address the original issue.

The main concern in #32 was improving visibility into what the scanners are actually doing, especially in cases where scans are skipped, partially executed, or fail silently. This PR mostly adjusts the global logging level, but it doesn’t significantly improve scanner-level observability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants