feat(logging): add --debug global flag for enhanced CLI logging#24
feat(logging): add --debug global flag for enhanced CLI logging#24
Conversation
Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
| fab_state_config.init_defaults() | ||
|
|
||
| # Set debug flag for enhanced logging if --debug is passed | ||
| if getattr(args, "debug", False): |
There was a problem hiding this comment.
@copilot would it work in interactive mode? via start_interactive_mode
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
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>
📥 Pull Request
✨ Description of new changes
Adds a
--debugglobal flag that enables verbose debug logging to both console and log file. Debug logging activates when either the flag is passed ORdebug_enabledconfig istrue.Changes
fab_global_params.py: Added--debugflag to global parser optionsfab_logger.py:set_verbose_enabled()andis_debug_enabled()functionslog_debug()now writes to console ([debug]prefix) and log fileis_debug_enabled()checkmain.py: Propagates--debugflag to logging systemfab_interactive.py: Added--debugflag support in interactive mode - enables per-command debugging without requiring config changesdocs/essentials/settings.md: Added "Debug Logging" documentation sectionUsage
Output shows log file location and prefixes debug messages with
[debug]:In interactive mode, the
--debugflag 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.