{"id":23821096,"url":"https://github.com/actuallytaylor/hydrogenreporter","last_synced_at":"2025-09-07T03:31:26.025Z","repository":{"id":154080009,"uuid":"631631080","full_name":"ActuallyTaylor/HydrogenReporter","owner":"ActuallyTaylor","description":"A light weight and feature packed SwiftUI debug tool with the capability to see view state console output","archived":false,"fork":false,"pushed_at":"2024-03-08T04:02:37.000Z","size":10505,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-06T14:49:03.997Z","etag":null,"topics":["debugging-tool","ios","logging","macos","reporter","swift","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":"https://actuallytaylor.com","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/ActuallyTaylor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["ActuallyTaylor"],"patreon":null,"open_collective":null,"ko_fi":"taylorlineman","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-04-23T16:22:12.000Z","updated_at":"2024-10-07T16:47:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"7670a387-2b4d-4e7d-ba56-9bd0a0f480c4","html_url":"https://github.com/ActuallyTaylor/HydrogenReporter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ActuallyTaylor/HydrogenReporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyTaylor%2FHydrogenReporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyTaylor%2FHydrogenReporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyTaylor%2FHydrogenReporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyTaylor%2FHydrogenReporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActuallyTaylor","download_url":"https://codeload.github.com/ActuallyTaylor/HydrogenReporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActuallyTaylor%2FHydrogenReporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273992371,"owners_count":25203728,"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-09-07T02:00:09.463Z","response_time":67,"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":["debugging-tool","ios","logging","macos","reporter","swift","swift-package-manager","swiftui"],"created_at":"2025-01-02T08:19:59.776Z","updated_at":"2025-09-07T03:31:25.441Z","avatar_url":"https://github.com/ActuallyTaylor.png","language":"Swift","funding_links":["https://github.com/sponsors/ActuallyTaylor","https://ko-fi.com/taylorlineman"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./assets/icon.png\" alt=\"Hydrogen Reporter Logo\" width=\"128\" maxHeight=“128\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/iOS-16.0+-green.svg\" /\u003e\n    \u003ca href=\"https://mastodon.social/@TaylorLineman\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contact-@TaylorLineman-blue.svg?style=flat\" alt=\"Mastodon: @TaylorLineman\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# Hydrogen Reporter\nA fast and lightweight SwiftUI console and view state reporter that can be used to see active logs and system statistics. Extremely useful for on the go debugging or when your apps need to be debugged over long periods of times that you can't be connected to a computer for!\n\n## Features\n- View and debug SwiftUI view state during app execution with no computer\n- Debug custom types with a simple extension\n- View current device statistics such as Ram and CPU usage\n- Add custom debug views to the reporter view\n- Only active during Debug sessions so no need to worry about removing for production!\n- View custom logs as they get sent to the console\n- View console output in app without the need for a connected debugger.\n\n### Export Logs\nAn example exported log!\n\n```\nHydrogen Reporter logs for 2023-04-23T15:22:07.650-04:00\n--- ✨ Total Logs: 23 ---\n--- 🛑 Total Fatal Error Logs: 0 ---\n--- 🥲 Total Error Logs: 2 ---\n--- ⚠️ Total Warn Logs: 2 ---\n--- 🤖 Total Info Logs: 10 ---\n--- ✅ Total Success Logs: 5 ---\n--- ⚙️ Total Working Logs: 6 ---\n--- 🔵 Total Debug Logs: 0 ---\n--- Fatal % 0 - Error % 0 - Warn % 0 - Info % 0 - Success % 0 - Working % 0 - Debug % 0 ---\n=== START LOGS ===\n⚙️ Establishing Stream - ~/StreamingManager.swift @ line 187, in function establishStream()\n✅ Web Socket did connect - ~/StreamingManager.swift @ line 384, in function urlSession(_:webSocketTask:didOpenWithProtocol:)\n🤖 Received Message - ~/StreamingManager.swift @ line 208, in function receive()\n🤖 Received Message - ~/StreamingManager.swift @ line 208, in function receive()\n🤖 Stream Cancelled - ~/StreamingManager.swift @ line 224, in function stopWatchingStream()\n🤖 Web Socket did close - ~/StreamingManager.swift @ line 405, in function urlSession(_:webSocketTask:didCloseWith:reason:)\n⚙️ Establishing Stream - ~/StreamingManager.swift @ line 187, in function establishStream()\n✅ Web Socket did connect - ~/StreamingManager.swift @ line 384, in function urlSession(_:webSocketTask:didOpenWithProtocol:)\n=== END LOGS ===\n```\n\n## Getting Started\n### Swift Package Manager\nAdd the following url to your Swift Packages through Xcode\n```\nhttps://github.com/ActuallyTaylor/HydrogenReporter\n```\n\n### Sample Code\n#### Initialization\nTo get started first import `HydrogenReporter` and then add the `.hydrogenReporter()` view modifier to your main view. This will initalize the reporter and add the floating menu to your app. The next step is to add your logger configuration so that Hydrogen can adapt to your needs. This is done by calling `Logger.shared.setLoggerConfig(config:)`.\n\n```swift\nimport HydrogenReporter\n\nstruct SampleApp: App {\n\n    init() {\n        Logger.shared.setLoggerConfig(config: .init(applicationName: \"Hydrogen Reporter\", defaultLevel: .info, defaultComplexity: .simple, leadingEmoji: \"⚫️\"))\n    }\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .hydrogenReporter()\n        }\n    }\n}\n```\n\n#### Adding a SwiftUI view to the reporter\nTo add your custom view to the reporter menu you just need to add the `.debuggable(self, id: \"ID\")` modifier to any view. This will register it with the reporter and allow you to view it's debuggable properties!\n\nThis sample adds the following Sample View to the reporter with the tag of Main View\n```swift\nstruct SampleView: View {\n    @State var string: String = \"Hello World\"\n\n    var body: some View {\n        NavigationView {\n            VStack {\n                TextField(\"Text\", text: $string)\n                    .textFieldStyle(.roundedBorder)\n\n                Button(\"Log Error\") {\n                    LOG(\"You just broke everything\", level: .error)\n                }\n                Button(\"Log Warning\") {\n                    LOG(\"You should not have done that\", level: .warn)\n                }\n                Button(\"Log Info\") {\n                    LOG(\"Chilling\", level: .info)\n                }\n                Button(\"Log Success\") {\n                    LOG(\"That worked!\", level: .success)\n                }\n                Button(\"Log Working\") {\n                    LOG(\"Working on something...\", level: .working)\n                }\n                Button(\"Log Debug\") {\n                    LOG(\"Print Debugging is where it is at\", level: .debug)\n                }\n            }\n        }\n        .debuggable(self, id: \"Main View\")\n    }\n}\n```\n\n#### Adding custom views to the reporter's menus\nIf you have custom needs for what you want to appear in the reporter (A custom debug menu) you can easily make Hydrogen take care of this view by adding it by registering it using the `.customDebuggableView()` modifier!. Just provide the view and then an ID to identify the view.\n\n```swift\nstruct SampleView: View {\n    @State var string: String = \"Hello World\"\n\n    var body: some View {\n        NavigationView {\n            VStack {\n                TextField(\"Text\", text: $string)\n                    .textFieldStyle(.roundedBorder)\n        }\n        .customDebuggableView(customView, id: \"Custom View\")\n    }\n    \n    var customView: some View {\n        VStack {\n            Text(\"A Custom View!\")\n            Text(\"Some State \\(string)\")\n        }\n    }\n}\n```\n\n### Logger\nThe Hydrogen Logger has the ability to swizzle the actual console output of your app and display it inside of the Hydrogen Reporter. This allows you to view console output as it happens without the need to switch away from print statements.\n\nIf you wish to see output within the `Logger` portion of Hydrogen reporter you can switch all (or some) of your `print` statements with `LOG`. `LOG` internally uses the same functions as `print` so the output will be nearly identical.\n\nI would recommend moving your `print` statements to `LOG` statements as they allow for you to set their awareness level and see a more comprehensive\n\n#### Using the logger\nTo use the logger you can call the function `LOG` for example:\n\n```swift\n// Log a simple message\nLOG(\"Completed Setup\")\n\n// Log an Error\nLOG(\"Purchasing Error:\", error, level: .error)\n\n// Debug Information\nLOG(\"Passed section 3\", level: .debug)\n```\n\n## Console\nHydrogen has a built in console that can mirror the Standard Error and the Standard Output files! This allows you to view the exact same console output that you would be able to in XCode. When Hydrogen first starts up, you will see the following output in your console informing you that Hydrogen has succesfully inserted itself into the console!\n\n```\nStarting Console Hijack...\nCompleted Console Hijack - Welcome to the Hydrogen Console 👋\n```\n\n## Reporter Screenshots\n### Logger\nThe logger view shows all of the logs that have been logged with `LOG`. Totals and percentages are also shown so you can see the overall statistics of your logs.\n\n![Screenshot of the Logger](./assets/logger.png)\n\n### View Inspector\nThe view inspector shows all of the state variables for an inspected view. They are shown side by side with their values.\n\n![Screenshot of the Inspector](./assets/inspector.jpeg)\n\n### Statistics View\nA screenshot of the device statistics page that shows you information about the currently running device. This screen is currently WIP.\n![Screenshot of the Logger](./assets/statistics.png)\n\n### Console\nA screenshot of the console when activated from the reporter view. Console logs from both Swift and your app are shown here.\n\n![Screenshot of the Console](./assets/debugConsole.png)\n\n# Contact\nAny questions that you have can be directed towards the GitHub issues or my [Mastodon account](https://mastodon.social/@TaylorLineman)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factuallytaylor%2Fhydrogenreporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factuallytaylor%2Fhydrogenreporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factuallytaylor%2Fhydrogenreporter/lists"}