CCNotify
CCNotify copied to clipboard
Make logging optional with --logging flag in installer
Description
Make logging functionality optional and disabled by default to prevent log files from growing too large. Logging should only be enabled when explicitly requested via a --logging flag during installation or update.
Context
Project area: Installer, CLI, Core functionality Complexity: 5/10 (moderate) Current state: Logging is always enabled and can create large log files over time
Technical Details
Affected files:
src/ccnotify/cli.py- Add--loggingflag to install/update commandssrc/ccnotify/installer/flows.py- Pass logging preference to hook configurationsrc/ccnotify/cli.py::update_claude_settings()- Update hook command with/without--loggingsrc/ccnotify/notify.py- Accept--loggingargument and conditionally enable loggingREADME.md- Document the new logging option
Requirements
-
Installer Changes
- Add
--loggingflag to theinstallandupdatecommands - When
--loggingis used, configure hooks to call the script with--logging - When not used, configure hooks without the logging flag
- Update existing installations to remove logging if not specified
- Add
-
Script Changes
- Modify
notify.pyto accept a--loggingcommand-line argument - Only enable logging when the flag is present
- Keep existing logging behavior when flag is used
- Completely disable logging (no file creation) when flag is absent
- Modify
-
Hook Configuration
- Update
update_claude_settings()to conditionally add--loggingto the hook command - Ensure the hook command is:
- With logging:
uv run /path/to/ccnotify.py --logging - Without logging:
uv run /path/to/ccnotify.py
- With logging:
- Update
-
Documentation
- Update README.md to document the
--loggingflag - Explain that logging is off by default
- Show how to enable logging during installation
- Update README.md to document the
Implementation Steps
- [ ] Add
--loggingflag to CLI install/update commands incli.py - [ ] Modify
BaseFlow._configure_claude_hooks()to accept logging preference - [ ] Update
update_claude_settings()to conditionally add--loggingto hook command - [ ] Add
--loggingargument parser tonotify.py - [ ] Modify
setup_logging()innotify.pyto check for the flag - [ ] Test installation with and without
--loggingflag - [ ] Verify hooks are configured correctly in both cases
- [ ] Update README.md with logging documentation
- [ ] Test that existing installations can be updated to remove logging
Acceptance Criteria
- [ ]
uvx ccnotify installinstalls without logging by default - [ ]
uvx ccnotify install --logginginstalls with logging enabled - [ ] Hook commands in Claude settings reflect the logging preference
- [ ] No log files are created when logging is disabled
- [ ] Existing installations can be updated to change logging preference
- [ ] Documentation clearly explains the logging option
- [ ] Script runs correctly with and without the
--loggingflag