{"id":23280232,"url":"https://github.com/nakkht/logr","last_synced_at":"2026-01-24T12:10:04.447Z","repository":{"id":56920015,"uuid":"194326841","full_name":"nakkht/logr","owner":"nakkht","description":"Dead simple logging library for iOS","archived":false,"fork":false,"pushed_at":"2022-07-09T19:05:37.000Z","size":1619,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-12T23:48:01.244Z","etag":null,"topics":["ios","ioslogging","log","logging","macos","spm","swift","swift-5-1","swift-5-3","swift-framework","swift5","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://nakkht.github.io/logr/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nakkht.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["nakkht"]}},"created_at":"2019-06-28T19:53:21.000Z","updated_at":"2025-02-24T06:38:36.000Z","dependencies_parsed_at":"2022-08-21T04:20:24.573Z","dependency_job_id":null,"html_url":"https://github.com/nakkht/logr","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakkht%2Flogr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakkht%2Flogr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakkht%2Flogr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakkht%2Flogr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nakkht","download_url":"https://codeload.github.com/nakkht/logr/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247488180,"owners_count":20946892,"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":["ios","ioslogging","log","logging","macos","spm","swift","swift-5-1","swift-5-3","swift-framework","swift5","tvos","watchos"],"created_at":"2024-12-19T23:31:00.826Z","updated_at":"2026-01-24T12:10:04.418Z","avatar_url":"https://github.com/nakkht.png","language":"Swift","funding_links":["https://github.com/sponsors/nakkht"],"categories":[],"sub_categories":[],"readme":"# Logr\n\n[![build](https://github.com/nakkht/logr/actions/workflows/build.yml/badge.svg)](https://github.com/nakkht/logr/actions/workflows/build.yml)\n[![unit test](https://github.com/nakkht/logr/actions/workflows/unit-test.yml/badge.svg)](https://github.com/nakkht/logr/actions/workflows/unit-test.yml)\n![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS-brightgreen)\n[![codecov](https://codecov.io/gh/nakkht/logr/branch/develop/graph/badge.svg)](https://codecov.io/gh/nakkht/logr)\n![code size](https://img.shields.io/github/languages/code-size/nakkht/logr?color=brightgreen)\n[![documentation](https://img.shields.io/badge/doc-reference-brightgreen)](https://nakkht.github.io/logr/)\n\nSimple logging library for iOS written in Swift\n\n## Features\n\n- [x] Inferred log message tags\n- [x] Swift Package Manager/Carthage/CocoaPods integration\n- [x] Highly extensible\n- [x] Logging to multiple targets/destination at the same time\n- [x] Console logging out of the box via ConsoleTarget\n- [x] File logging out of the box via FileTarget \n- [x] Pure Swift 5\n- [x] Optional file header for each file\n- [x] Automatic file archive based on size or time span\n\n## Integration\n\n### Swift Package Manager\n\nOnce Swift package set up, add the following to your `Package.swift`:\n\n```\ndependencies: [\n  .package(url: \"https://github.com/nakkht/logr.git\", exact: \"0.11.0\")\n]\n```\n\n## Usage\n\nIn your `AppDelegate.swift` file add:\n\n```swift\nimport Logr\n```\n\nAt the beginning of `func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool` configure logr service with wanted targets:\n\n```swift\nLogrService.init(with: Config(ConsoleTarget(), FileTarget()))\n``` \n\nFor more serious configuration in production, it is recommended to ommit `ConsoleTarget`. For example:\n\n```swift\n#if DEBUG\nstatic let targets: [Target] = [ConsoleTarget(), FileTarget()]\n#else\nstatic let targets: [Target] = [FileTarget()]\n#endif\n\nstatic let config = Config(targets: targets)\n\nLogrService.init(with: config)\n```\n\nThe set targets will be used across the whole application.\n\nTo log messages, simply create `Logr` instance in class initializer and start logging. For example:\n\n```swift\nimport Logr\n\nclass ViewController: UIViewController {\n\n    private let logr = Logr()\n\n    func logDebug() {\n        logr.debug(\"debug message to be logged\")\n    }\n}\n```\n\n## Demo\n\nDemo project can be access by opening Demo.workspace in Demo sub-folder.\n\n## Documentation\n\n- [Documentation](https://nakkht.github.io/logr/) generated with [jazzy](https://github.com/realm/jazzy). Hosted by [GitHub Pages](https://pages.github.com).\n- [Architecture document](https://github.com/nakkht/logr/wiki/Architecture) available in project wiki\n\n## Author\n* [Paulius Gudonis](https://pgu.dev)\n\n## Licence\nThis repository is under the **Apache v2.0** license. [Find it here](https://github.com/nakkht/logr/blob/main/LICENSE).\n\n    Copyright 2021 Paulius Gudonis\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakkht%2Flogr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakkht%2Flogr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakkht%2Flogr/lists"}