Skip to content

Conversation

@medihack
Copy link
Member

@medihack medihack commented Nov 8, 2025

Fixes #1405

The CLI code was using PROCRASTINATE_VERBOSE as the environment variable, while the documentation incorrectly specified PROCRASTINATE_VERBOSITY. Additionally, the documentation claimed to support 3 log levels (warning, info, debug), but the code only supports 2 levels (info at 0, debug at 1+).

Changes:

  • Fixed documentation to use PROCRASTINATE_VERBOSE (matching the code)
  • Added new --log-level option (mutually exclusive with -v) that allows explicit control over all log levels: debug, info, warning, error, critical
  • Added PROCRASTINATE_LOG_LEVEL environment variable support
  • Updated documentation to reflect actual behavior and document new options
  • Updated help text to clearly show verbosity levels: 0=info, 1+=debug
  • Added comprehensive tests to verify:
    • PROCRASTINATE_VERBOSE environment variable works correctly
    • Command line flags override (not add to) environment variables
    • --log-level option works with all log levels
    • --log-level and -v are mutually exclusive
    • PROCRASTINATE_LOG_LEVEL environment variable works correctly

Successful PR Checklist:

  • Tests
    • (not applicable?)
  • Documentation
    • (not applicable?)

PR label(s):

Fixes procrastinate-org#1405

The CLI code was using PROCRASTINATE_VERBOSE as the environment variable,
while the documentation incorrectly specified PROCRASTINATE_VERBOSITY.
Additionally, the documentation claimed to support 3 log levels (warning,
info, debug), but the code only supports 2 levels (info at 0, debug at 1+).

Changes:
- Fixed documentation to use PROCRASTINATE_VERBOSE (matching the code)
- Command line flags (-v, -vv) now properly override environment variables
  instead of adding to them
- Added new --log-level option (mutually exclusive with -v) that allows
  explicit control over all log levels: debug, info, warning, error, critical
- Added PROCRASTINATE_LOG_LEVEL environment variable support
- Updated documentation to reflect actual behavior and document new options
- Updated help text to clearly show verbosity levels: 0=info, 1+=debug
- Added comprehensive tests to verify:
  * PROCRASTINATE_VERBOSE environment variable works correctly
  * Command line flags override (not add to) environment variables
  * --log-level option works with all log levels
  * --log-level and -v are mutually exclusive
  * PROCRASTINATE_LOG_LEVEL environment variable works correctly

All existing tests pass, and new tests confirm all functionality works as expected.
@medihack medihack requested a review from a team as a code owner November 8, 2025 18:58
@github-actions github-actions bot added the PR type: bugfix 🕵️ Contains bug fix label Nov 8, 2025
@medihack medihack marked this pull request as draft November 8, 2025 18:58
@github-actions
Copy link

github-actions bot commented Nov 8, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  cli.py
Project Total  

This report was generated by python-coverage-comment-action

Verifies that when configure_logging() is called with no arguments
(no verbosity or log_level specified), it defaults to logging.INFO level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR type: bugfix 🕵️ Contains bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PROCRASTINATE_VERBOSE vs. PROCRASTINATE_VERBOSITY

2 participants