{"id":18060263,"url":"https://github.com/thepearl/echo","last_synced_at":"2026-05-14T23:13:09.547Z","repository":{"id":260177207,"uuid":"856393741","full_name":"thepearl/Echo","owner":"thepearl","description":"Echo: A flexible and lightweight logger with in-app visualiser for Swift iOS applications.","archived":false,"fork":false,"pushed_at":"2025-06-30T07:45:41.000Z","size":79,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T12:37:16.840Z","etag":null,"topics":["combine","ios-sdk","ios-swift","ios14","logger","spm","swift","swiftui","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thepearl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-12T14:03:54.000Z","updated_at":"2025-08-11T08:55:01.000Z","dependencies_parsed_at":"2025-05-15T11:21:45.158Z","dependency_job_id":"aa41e45a-5773-4183-bd48-c10ba8102786","html_url":"https://github.com/thepearl/Echo","commit_stats":null,"previous_names":["thepearl/echo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thepearl/Echo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepearl%2FEcho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepearl%2FEcho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepearl%2FEcho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepearl%2FEcho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thepearl","download_url":"https://codeload.github.com/thepearl/Echo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepearl%2FEcho/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001432,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["combine","ios-sdk","ios-swift","ios14","logger","spm","swift","swiftui","xcode"],"created_at":"2024-10-31T04:06:45.439Z","updated_at":"2025-10-09T12:37:17.258Z","avatar_url":"https://github.com/thepearl.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Echo 🔊\n\nA comprehensive logging system for iOS applications that provides robust logging capabilities with support for network request tracking, persistence, and visualization.\n\n## Features\n\n- **📊 Multiple Log Levels**: Debug, Info, Warning, Error, and Critical\n- **🏷️ Log Categories**: Organize logs by application areas (Network, UI, Database, etc.)\n- **🌐 Network Request Monitoring**: Automatic HTTP request/response logging\n- **💾 Persistent Storage**: Core Data-based log persistence with rotation\n- **📱 Visual Log Viewer**: SwiftUI-based log viewer with filtering and search\n- **🔍 Advanced Filtering**: Filter by level, category, date range, and search terms\n- **📤 Export Capabilities**: Export logs for analysis or sharing\n- **⚡ Performance Monitoring**: Track view rendering performance\n- **🎯 SwiftUI Modifiers**: Easy integration with declarative logging modifiers\n\n## Installation\n\n### Swift Package Manager\n\nAdd Echo to your project using Swift Package Manager:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/thepearl/Echo.git\", branch: \"master\")\n]\n```\n\n## Quick Start\n\n### Basic Logging\n\n```swift\nimport Echo\n\n// Create a logger instance\nlet logger = Echo.Logger()\n\n// Log messages with different levels\nlogger.log(.info, category: .network, message: \"API request started\")\nlogger.log(.error, category: .database, message: \"Failed to save user data\")\nlogger.log(.warning, category: .userInterface, message: \"Slow animation detected\")\n```\n\n### Network Logging\n\nEnable automatic network request logging:\n\n```swift\n// Enable network logging\nlogger.enableNetworkLogging()\n\n// Use URLSession with Echo's configuration\nlet session = URLSession(configuration: Echo.urlSessionConfiguration())\n\n// All network requests will now be automatically logged\n```\n\n### SwiftUI Integration\n\n```swift\nimport SwiftUI\nimport Echo\n\nstruct ContentView: View {\n    let logger = Echo.Logger()\n    \n    var body: some View {\n        VStack {\n            Text(\"Welcome\")\n                .echoPageAppearance(logger: logger, pageName: \"Home Screen\")\n                .echoUserInteraction(logger: logger, interactionName: \"Welcome Text\")\n        }\n        .echoViewLifecycle(logger: logger, viewName: \"ContentView\")\n    }\n}\n```\n\n## Configuration\n\nCustomize the logger behavior with `LoggerConfiguration`:\n\n```swift\nlet config = Echo.LoggerConfiguration(\n    minimumLogLevel: .info,        // Only log info and above\n    maxLogEntries: 5000,           // Keep up to 5000 log entries\n    logRotationInterval: 86400,    // Rotate logs daily\n    activeTimeRange: nil           // Log 24/7 (or specify time range)\n)\n\nlet logger = Echo.Logger(configuration: config)\n```\n\n## Log Levels\n\nEcho supports five log levels in order of severity:\n\n- **Debug**: Detailed information for debugging\n- **Info**: General information about program execution\n- **Warning**: Potentially harmful situations\n- **Error**: Error events that might allow the application to continue\n- **Critical**: Severe error events that may lead to application termination\n\n## Log Categories\n\nBuilt-in categories help organize your logs:\n\n- `uncategorized`: Default category\n- `network`: Network-related operations\n- `userInterface`: UI interactions and lifecycle\n- `lifecycle`: Application/view lifecycle events\n- `database`: Database operations\n- `authentication`: Authentication and security\n- `businessLogic`: Core business logic\n- `performance`: Performance monitoring\n\nCreate custom categories:\n\n```swift\nlet customCategory = Echo.LogCategory(\"CustomFeature\")\nlogger.log(.info, category: customCategory, message: \"Custom feature activated\")\n```\n\n## Visual Log Viewer\n\nDisplay logs in your app with the built-in SwiftUI viewer:\n\n```swift\nimport SwiftUI\nimport Echo\n\nstruct LogViewerScreen: View {\n    let logger = Echo.Logger()\n    \n    var body: some View {\n        LogViewer(logger: logger)\n    }\n}\n```\n\nThe log viewer includes:\n- **Search**: Filter logs by message content\n- **Level Filtering**: Show/hide specific log levels\n- **Category Filtering**: Filter by log categories\n- **Date Range Filtering**: View logs from specific time periods\n- **Sorting**: Sort by timestamp, level, or category\n- **Export**: Share logs via system share sheet\n- **Detail View**: Tap any log for detailed information including network details\n\n## SwiftUI Modifiers\n\nEcho provides convenient SwiftUI modifiers for declarative logging:\n\n### Page Appearance Logging\n\n```swift\nContentView()\n    .echoPageAppearance(\n        logger: logger,\n        pageName: \"Settings Screen\",\n        category: .userInterface,\n        level: .info\n    )\n```\n\n### View Lifecycle Logging\n\n```swift\nUserProfileView()\n    .echoViewLifecycle(\n        logger: logger,\n        viewName: \"UserProfile\",\n        category: .lifecycle,\n        level: .info,\n        logDisappear: true\n    )\n```\n\n### User Interaction Logging\n\n```swift\nButton(\"Save\") { saveData() }\n    .echoUserInteraction(\n        logger: logger,\n        interactionName: \"Save Button\",\n        category: .userInterface,\n        level: .info\n    )\n```\n\n### Navigation Logging\n\n```swift\nDetailView()\n    .echoNavigation(\n        logger: logger,\n        screenName: \"Product Detail\",\n        screenData: [\"productId\": product.id, \"category\": product.category]\n    )\n```\n\n### Performance Monitoring\n\n```swift\nComplexView()\n    .echoPerformance(logger: logger, viewName: \"ComplexView\")\n```\n\n### Combined Logging\n\n```swift\nMainView()\n    .echoPageAndInteractions(\n        logger: logger,\n        name: \"Main Screen\",\n        category: .userInterface,\n        level: .info\n    )\n```\n\n## Advanced Features\n\n### Network Request Details\n\nWhen network logging is enabled, Echo captures comprehensive request/response data:\n\n- Request URL, method, headers, and body\n- Response status code, headers, and body\n- Request duration\n- Error details (if any)\n\n### Log Export\n\nExport logs programmatically:\n\n```swift\nlet exportedLogs = logger.exportLogs()\n// Share or save the exported log string\n```\n\n### Log Management\n\n```swift\n// Clear all logs\nlogger.clearLogs()\n\n// Flush pending logs to storage\nlogger.flushBuffer()\n\n// Disable network logging\nlogger.disableNetworkLogging()\n```\n\n### Persistent Storage\n\nEcho automatically manages log persistence using Core Data:\n- Logs are saved to device storage\n- Automatic log rotation based on configuration\n- Archived logs are saved as JSON files\n- Efficient memory management with buffering\n\n## Best Practices\n\n1. **Use Appropriate Log Levels**: Reserve `.critical` for severe errors, use `.debug` for detailed troubleshooting\n2. **Categorize Logs**: Use specific categories to organize logs by feature or component\n3. **Include Context**: Provide meaningful messages with relevant context\n4. **Monitor Performance**: Use performance logging for views that might be slow\n5. **Configure Limits**: Set appropriate `maxLogEntries` to balance storage and performance\n6. **Network Logging**: Be mindful of sensitive data in network requests when logging is enabled\n\n## Example App Integration\n\n```swift\nimport SwiftUI\nimport Echo\n\n@main\nstruct MyApp: App {\n    let logger = Echo.Logger(configuration: Echo.LoggerConfiguration(\n        minimumLogLevel: .info,\n        maxLogEntries: 10000\n    ))\n    \n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .environmentObject(logger)\n                .onAppear {\n                    logger.enableNetworkLogging()\n                    logger.log(.info, category: .lifecycle, message: \"App launched\")\n                }\n        }\n    }\n}\n\nstruct ContentView: View {\n    @EnvironmentObject var logger: Echo.Logger\n    @State private var showingLogs = false\n    \n    var body: some View {\n        NavigationView {\n            VStack {\n                // Your app content\n                Text(\"My App\")\n                \n                Button(\"View Logs\") {\n                    showingLogs = true\n                }\n            }\n            .echoPageAppearance(logger: logger, pageName: \"Main Screen\")\n            .sheet(isPresented: $showingLogs) {\n                LogViewer(logger: logger)\n            }\n        }\n    }\n}\n```\n\n## Requirements\n\n- iOS 14.0+ / macOS 11.0+ / tvOS 14.0+\n- Swift 5.3+\n- Xcode 12.0+\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nEcho is available under the MIT license. See the LICENSE file for more info.\n\n---\n\n**Echo** - Making iOS debugging more transparent, one log at a time. 🔊\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepearl%2Fecho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepearl%2Fecho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepearl%2Fecho/lists"}