{"id":29222340,"url":"https://github.com/thieurom/journeylog","last_synced_at":"2025-07-03T03:30:19.507Z","repository":{"id":186249272,"uuid":"674868409","full_name":"Thieurom/JourneyLog","owner":"Thieurom","description":"A simple wrapper of `os.Logger` and `OSLogStore` to log and export log entries.","archived":false,"fork":false,"pushed_at":"2023-08-05T04:40:36.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-08-05T05:29:52.351Z","etag":null,"topics":["logging","spm","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thieurom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-05T02:41:40.000Z","updated_at":"2023-08-05T05:29:54.379Z","dependencies_parsed_at":null,"dependency_job_id":"fd5a8aa0-db72-4710-a3ea-2f5a81a905fe","html_url":"https://github.com/Thieurom/JourneyLog","commit_stats":null,"previous_names":["thieurom/journeylog"],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/Thieurom/JourneyLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thieurom%2FJourneyLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thieurom%2FJourneyLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thieurom%2FJourneyLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thieurom%2FJourneyLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thieurom","download_url":"https://codeload.github.com/Thieurom/JourneyLog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thieurom%2FJourneyLog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263253224,"owners_count":23437815,"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":["logging","spm","swift"],"created_at":"2025-07-03T03:30:18.157Z","updated_at":"2025-07-03T03:30:19.474Z","avatar_url":"https://github.com/Thieurom.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JourneyLog\n\nA simple wrapper of `os.Logger` and `OSLogStore` to log and export entries.\n\n## Usage\n\n1. Define your log types by conforming to `LogEvent`. It's preferable to group them into an `enum`:\n```swift\nenum LogType: LogEventType {\n    case app\n    case api\n\n    var category: String {\n        switch self {\n        case .app:\n            return \"App\"\n        case .api:\n            return \"API\"\n        }\n    }\n}\n```\n\n2. Create a logger for your app:\n```swift\nlet log = JourneyLog\u003cLogType\u003e(identifier: \"identifier\")\n```\n\nThe provided \"identifier\" will identify your log as a subsystem in Apple's unified logging system. Typically, you use the same value as your app’s _bundle ID_, for example, `com.yourcompany.yourapp`.\n\n3. Start logging:\n```swift\nlog.info(.app, \"App launches\")\nlog.warning(.app, \"Feature is not implemented\")\n\nlet url = URL(string: \"www.example.com\")!\nlog.debug(.api, \"Request: \\(url)\")\n\nlet error = APIError.dataNotFound\nlog.error(.api, \"Request failed with error: \\(error)\")\n```\n\nIt will show to Xcode Console:\n\n![](./.github/images/xcode-console-log.png?raw=true)\n\n4. Export the log entries:\n```swift\ndo {\n    let entries = try await log.exportEntries() // -\u003e [LogEntry]\n    let logText = entries\n        .map {\n            \"\\(dateFormatter.string(from: $0.date)) \\($0.process) [\\($0.category)] \\($0.composedMessage)\"\n        }\n} catch {\n    // Handle error\n}\n```\n\n## Installation\nJourneyLog requires iOS from `15.0` and macOS from `12.0`.\n\nYou can add JourneyLog to an Xcode project as a package dependency.\n\u003e https://github.com/Thieurom/JourneyLog\n\nIf you want to use JourneyLog in a SwiftPM project, it's as simple as adding it to a dependencies clause in your Package.swift:\n```swift\ndependencies: [\n  .package(url: \"https://github.com/Thieurom/JourneyLog\", from: \"0.1.0\")\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieurom%2Fjourneylog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthieurom%2Fjourneylog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieurom%2Fjourneylog/lists"}