Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

📥 Pull Request

✨ Description of new changes

Adds a --debug global flag that enables verbose debug logging to both console and log file. Debug logging activates when either the flag is passed OR debug_enabled config is true.

Changes

  • fab_global_params.py: Added --debug flag to global parser options
  • fab_logger.py:
    • Added set_verbose_enabled() and is_debug_enabled() functions
    • log_debug() now writes to console ([debug] prefix) and log file
    • All HTTP logging functions use unified is_debug_enabled() check
  • main.py: Propagates --debug flag to logging system
  • fab_interactive.py: Added --debug flag support in interactive mode - enables per-command debugging without requiring config changes
  • docs/essentials/settings.md: Added "Debug Logging" documentation section
  • Tests: Added coverage for new debug flag functionality

Usage

# Per-command debug logging (command-line mode)
fab ls / --debug

# Per-command debug logging (interactive mode)
fab:/$ ls / --debug

# Persistent debug logging via config
fab config set debug_enabled true

Output shows log file location and prefixes debug messages with [debug]:

! '--debug' is on (/home/user/.local/state/fabric-cli/log/fabcli_debug.log)
[debug] Error using encrypted cache: ...

In interactive mode, the --debug flag is only active for the specific command it's passed to and automatically resets after command execution, allowing targeted debugging of individual commands.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 25, 2026 12:59
Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance CLI logging with fab_debug for detailed output feat(logging): add --debug global flag for enhanced CLI logging Jan 25, 2026
Copilot AI requested a review from ayeshurun January 25, 2026 13:04
fab_state_config.init_defaults()

# Set debug flag for enhanced logging if --debug is passed
if getattr(args, "debug", False):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot would it work in interactive mode? via start_interactive_mode

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, --debug does not work for individual commands in interactive mode. The flag is only parsed once in main() before start_interactive_mode() is called. The handle_command() method in fab_interactive.py parses subcommands but doesn't check for --debug.

For debugging in interactive mode, users should use fab config set debug_enabled true which persists the setting and is checked by is_debug_enabled() for every command.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot if i don't want in interactive mode to set the config, and just want to debug specific command. please add support as well in interactive mode

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for --debug flag in interactive mode (445d281). Now you can run individual commands with --debug like ls / --debug and the debug logging will be enabled for just that command, then automatically reset after execution.

Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
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