Skip to content

Add JSON and structured logging output #17

@SH20RAJ

Description

@SH20RAJ

🎯 Goal

Implement machine-readable output formats for automation and integration.

🚀 Features

cleanmac --json              # Output as JSON
cleanmac --log report.txt    # Save to file
cleanmac --log report.md     # Markdown format
cleanmac --log report.json   # JSON format

📊 JSON Output Format

{
  "status": "success",
  "timestamp": "2025-10-06T14:23:45Z",
  "summary": {
    "space_freed": "32.9GB",
    "files_deleted": 3319,
    "duration": "4m 32s"
  },
  "disk_usage": {
    "before": {
      "used": "245GB",
      "free": "98GB",
      "percentage": 72
    },
    "after": {
      "used": "210GB",
      "free": "133GB",
      "percentage": 61
    }
  },
  "categories": [
    {
      "name": "Project Folders",
      "space_freed": "8.2GB",
      "files_deleted": 1247,
      "duration": "45s"
    }
  ]
}

✅ Acceptance Criteria

  • --json produces valid JSON
  • --log saves to file
  • Multiple formats supported
  • JSON is machine-parseable
  • Markdown is human-readable

🔗 Related

Part of Phase 3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions