{"id":15038911,"url":"https://github.com/stanwood/harlow","last_synced_at":"2025-04-10T00:03:28.587Z","repository":{"id":43326590,"uuid":"124886674","full_name":"stanwood/Harlow","owner":"stanwood","description":"ヽ༼ಠل͜ಠ༽ﾉ Harlow is an advanced iOS In App logging \u0026 debugging 🐛 framework written in Swift, with comprehensive logs for Analytics, Networking, Errors, Crashes and Print logs","archived":false,"fork":false,"pushed_at":"2021-04-06T13:45:34.000Z","size":76754,"stargazers_count":8,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T00:03:25.675Z","etag":null,"topics":["analytics","analytics-logging","analytics-tracking","error-monitoring","error-reporting","ios","logger","logging","logging-framework","logging-library","network","network-analysis","network-monitoring","swift","swift4"],"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/stanwood.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-12T12:36:19.000Z","updated_at":"2023-12-27T08:34:59.000Z","dependencies_parsed_at":"2022-09-02T15:02:25.808Z","dependency_job_id":null,"html_url":"https://github.com/stanwood/Harlow","commit_stats":null,"previous_names":["stanwood/stanwood_debugger_ios"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanwood%2FHarlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanwood%2FHarlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanwood%2FHarlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanwood%2FHarlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stanwood","download_url":"https://codeload.github.com/stanwood/Harlow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131321,"owners_count":21052819,"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","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":["analytics","analytics-logging","analytics-tracking","error-monitoring","error-reporting","ios","logger","logging","logging-framework","logging-library","network","network-analysis","network-monitoring","swift","swift4"],"created_at":"2024-09-24T20:40:44.444Z","updated_at":"2025-04-10T00:03:28.544Z","avatar_url":"https://github.com/stanwood.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![banner](assets/banner.png)\n\n[![Swift Version](https://img.shields.io/badge/Swift-5.x-orange.svg)]()\n[![iOS 10+](https://img.shields.io/badge/iOS-10+-EB7943.svg)]() [![Maintainability](https://api.codeclimate.com/v1/badges/1a2096a936f5ea9548ac/maintainability)](https://codeclimate.com/github/stanwood/Harlow/maintainability)\n[![Build Status](https://travis-ci.org/stanwood/Harlow.svg?branch=master)](https://travis-ci.org/stanwood/Harlow)\nDebugging and testing iOS applications can be quite a long task due to the nature of Software Development. _Harlow_ tool provides reach information on Analytics, Errors, Logging, Networking, and UITesting to simplify this process.\n\n[![Demo Harlow](https://j.gifs.com/Q0ZWr9.gif)]()\n\n## Table of contents\n\n- [Author](#author)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Licence](#licence)\n- [Changelog](#changelog)\n\n\n## Author\n\nTal Zion tal.zion@stanwood.io\n\n## Installation\n\n```ruby\npod 'Harlow', :configurations =\u003e ['Debug'] # Make sure to only use Harlow for development only.\n```\n\n## Usage\n\n```swift\n#if DEBUG\nimport Harlow\n#endif\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    var window: UIWindow?\n\n    #if DEBUG\n    lazy var debugger: Harlow = Harlow()\n    #endif\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n\n        #if DEBUG\n        debugger.isEnabled = true\n        #endif\n    }\n}\n```\n\n### Other options\n\n```swift\ndebugger.isDebuggingDataPersistenceEneabled = true /// Enables local data persistance\ndebugger.enabledServices: [Service] = [.logs, .errors] /// The services you would like to enable. Default is se to `allCases`\ndebugger.tintColor = .red /// Change the tint color\ndebugger.errorCodesExceptions = [4097] /// Add error code exceptions\ndebugger.isShakeEnabled = true // Defaults to `true`. When this is `true`, shaking the device will enable/disable the Debugger\ndebugger.isEnabled = true\n```\n\n## Adding logs\n\n### Analytics\n\n##### Option 1.\n\nSet up your tracking payload:\n\n```swift\npublic func payload() -\u003e [String:String] {\n\n    var payload: [String:String] = [\"eventName\": eventName]\n\n    if let itemId = itemId {\n        payload[\"itemId\"] = itemId\n    }\n\n    if let category = category {\n        payload[\"category\"] = category\n    }\n\n    if let contentType = contentType {\n        payload[\"contentType\"] = contentType\n    }\n\n    if let screenName = screenName {\n        payload[\"screenName\"] = screenName\n    }\n\n    let dateFormatter = DateFormatter()\n    dateFormatter.dateFormat = \"yyyy-MM-dd'T'HH:mm:ssZ\"\n\n    payload[\"createdAt\"] = dateFormatter.string(from: Date())\n\n    return payload\n}\n```\n\nPost it to:\n\n```swift\nfunc post(_ payload: [String:String]) {\n    let notificationCentre = NotificationCenter.default\n    let notification = Notification.init(name: Notification.Name(rawValue: \"io.stanwood.debugger.didReceiveAnalyticsItem\"), object: nil, userInfo: payload)\n    notificationCentre.post(notification)\n}\n```\n\n##### Option 2.\n\nUse [StanwoodAnalytics](https://github.com/stanwood/Stanwood_Analytics_iOS) as your tracking framework\n\n```swift\n#if DEBUG\nanalyticsBuilder = analyticsBuilder.setDebuggerNotifications(enabled: true)\n#endif\n```\n\n### Networking\n\n`Harlow` works by default with `URLSessiosn.shared` and request are beeing logged for free. You can also register a custom condiguration: \n\n```swift\nlet configuration = URLSessionConfiguration.waitsForConnectivity\n\ndebugger.regsiter(custom: configuration)\n\n/// Use with URLSession || any networking libraries such as Alamofire and Moya\nlet session = URLSession(configuration: configuration)\n```\n\n\u003cimg src=\"Media/stanwood_debugger_networking.gif\" alt=\"Module\" width=\"300\"\u003e\n\n### Error\n\n`Harlow` will log `NSError` by default.  To add log exceptions:\n\n```swift\ndebugger.errorCodesExceptions = [4097] /// Add error code exceptions\n```\n\n### Logs\n\n`Harlow` will log `print` \u0026\u0026 `debugPrint` by default.\n\n#### Configuration:\n\n1. Create a new `Bridging-Header` file and add `-DEBUG` suffix\n\n![logs-1](Media/logs-1.png)\n\n2. Import `Harlow`\n\n```objc\n@import Harlow;\n```\n\n\u003eNote: Make sure to add any other imported libraries from your main header file\n\n3. Set `Bridging-Header-DEBUG.h` in the relevant configurations in the build settings.\n\n![logs-3](Media/logs-3.png)\n\n### Crashes\n\n`Harlow` will log `Signal` and `NSException` crashes by default.\n\n## Licence\n\nHarlow is under MIT licence. See the [LICENSE](https://github.com/stanwood/Harlow/blob/master/LICENSE.md) file for more info.\n\n## Changelog\n\nA brief summary of each Harlow release can be found in the [CHANGELOG](https://github.com/stanwood/Harlow/blob/master/CHANGELOG.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanwood%2Fharlow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanwood%2Fharlow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanwood%2Fharlow/lists"}