Skip to content

Feat/stdoutcleanup#21

Merged
yusuf-jkhan1 merged 13 commits intomainfrom
feat/stdoutcleanup
Aug 15, 2025
Merged

Feat/stdoutcleanup#21
yusuf-jkhan1 merged 13 commits intomainfrom
feat/stdoutcleanup

Conversation

@yusuf-jkhan1
Copy link
Owner

No description provided.

Ysf and others added 13 commits August 15, 2025 17:59
- Replace deprecated e.output with e.stdout in error handling
- Add stderr logging for both success and failure cases
- Ensure consistent return values between success/error paths

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Plan includes:
1. Integrate stdout_parser into Copy.execute()
2. Improve console logging format (keep timestamps)
3. Add Rich-based summary method to parser
4. Integrate Loguru + Rich for pretty output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add rich and loguru dependencies to requirements.txt
- Import AzCopyStdoutParser in copy.py
- Modify Copy.execute() to return parsed object instead of raw tuple
- Add exit_code and raw_stdout attributes to parsed object
- Update docstring to reflect new return type

Developers can now access structured data via attributes like:
result.job_id, result.final_job_status, result.files_transferred

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update CopyLogger console formatter to use cleaner [COPY] prefix
- Update JobsLogger console formatter to use cleaner [JOBS] prefix
- Keep timestamps but use cleaner YYYY-MM-DD HH:MM:SS format
- File logging format remains unchanged for detailed debugging

Console output now shows:
2025-08-15 18:12:27 [INFO] [COPY] Run: lively-haze-7339

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Import Rich console and table components
- Add summary() method to AzCopyStdoutParser
- Use status-appropriate icons (✅/⚠️/❌) and colors
- Create formatted table with transfer metrics
- Handle None values safely with defaults
- Truncate job ID for cleaner display
- Return rendered string for easy printing

Developers can now call result.summary() for beautiful output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
BaseCommand changes:
- Import Rich console, panel, and syntax components
- Add pretty command display with syntax highlighting in blue panel
- Show command output in green panel with emoji titles
- Display errors in red panels with structured content
- Keep original file logging format for debugging

Copy command changes:
- Display Rich summary table after execution
- Maintain all existing functionality with enhanced UX

Output now shows beautiful panels and formatted tables

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
✅ Completed improvements:
1. Integrate stdout_parser into Copy.execute()
2. Improve console logging format (keep timestamps)
3. Add Rich-based summary method
4. Integrate Rich for pretty output

🚀 New Phase 2 improvements:
5. Remove redundant command output
6. Improve flag config display with Rich formatting
7. Improve command display readability with multi-line format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Improvement 5 - Remove Redundant Command Output:
- Keep detailed logging in files only
- Show Rich panels on console without duplication
- Clear separation between file logs and console display

Improvement 6 - Improve Flag Config Display:
- Filter out null/None values from config display
- Add Rich table for configuration flags with 🏁 icon
- Show only active flags in clean tabular format

Improvement 7 - Improve Command Display Readability:
- Replace long single-line command with multi-line format
- Use 'azcopy' instead of full binary path
- Label positional arguments (source, destination)
- Break options across lines with proper formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Suppress console logger calls for flag config (keep Rich table only)
- Suppress console logger calls for command/output (keep Rich panels only)
- Maintain file logging for debugging purposes
- Eliminates duplicate display of flag config and command output

Now users see clean Rich-formatted output without duplication

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove duplicate transfer summary Rich table from Copy.execute()
- AzCopy command output already provides comprehensive job summary
- Eliminates information overlap and reduces visual clutter
- Parsed object still available for programmatic access to metrics

Clean output now shows: config flags, command, and native AzCopy results

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Configuration Table:
- Calculate width based on flag and value lengths
- Min 40, max 80 characters to prevent excessive width

Command Panel:
- Width based on longest command line + padding
- Min 60, max 100 characters for readability

Output/Error Panels:
- Width based on longest content line + padding
- Min 60, max 120 characters to handle varied output

Panels now adapt to content size and work well on smaller screens

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ual separation

- Replace complex haikunator-based directory structure with simple ~/.azpype/ layout
- Remove haikunator dependency from requirements.txt
- Implement daily log rotation with dynamic filenames: azpype_YYYY-MM-DD.log
- Add automatic compression and 7-day retention using loguru
- Capture all command output (stdout/stderr) in log files with visual separators
- Add clear visual separation using === blocks for easy log inspection
- Consolidate CopyLogger/JobsLogger into single AzpypeLogger class
- Maintain AzCopy environment variables (AZCOPY_JOB_PLAN_LOCATION, AZCOPY_LOG_LOCATION)
- Preserve backward compatibility through legacy wrapper classes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yusuf-jkhan1 yusuf-jkhan1 merged commit 6f0dcc5 into main Aug 15, 2025
3 checks passed
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.

1 participant