Skip to content

Add --log-level CLI flag for debug logging#20

Closed
mac-agent wants to merge 1 commit intoBortlesboat:mainfrom
mac-agent:fix/issue-12-log-level
Closed

Add --log-level CLI flag for debug logging#20
mac-agent wants to merge 1 commit intoBortlesboat:mainfrom
mac-agent:fix/issue-12-log-level

Conversation

@mac-agent
Copy link
Copy Markdown

Summary

Fixes #12

This PR adds a --log-level CLI flag to control logging verbosity, and moves the module-level logging.basicConfig call into main() so it respects the flag.

Changes

  1. Removed module-level logging.basicConfig from line 23 — logging is now configured in main() after argument parsing.

  2. Added --log-level argument to argparse with choices: DEBUG, INFO, WARNING, ERROR (default: INFO).

  3. Added tests:

    • test_log_level_accepted — verifies all valid levels are accepted
    • test_invalid_log_level_rejected — verifies invalid values are rejected

Usage

# Default (INFO)
bitcoin-mcp

# Debug mode for troubleshooting
bitcoin-mcp --log-level DEBUG

# Quiet mode
bitcoin-mcp --log-level WARNING

Acceptance Criteria

  • bitcoin-mcp --log-level DEBUG produces debug output on stderr
  • bitcoin-mcp with no flag defaults to INFO (no breaking change)
  • bitcoin-mcp --log-level WARNING suppresses info messages
  • Added tests verifying the flag is accepted by argparse
  • Module-level logging.basicConfig removed

- Moved logging.basicConfig from module level into main()
- Added --log-level argument (DEBUG/INFO/WARNING/ERROR, default INFO)
- Added tests verifying the flag is accepted and invalid values rejected

Fixes Bortlesboat#12
@Bortlesboat
Copy link
Copy Markdown
Owner

Closing this as superseded by #31, which consolidates the open backlog work into one maintainer sweep. Thank you for the contribution and the concrete issue coverage here.

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.

Add --log-level CLI flag for debug logging

2 participants