{"id":18060640,"url":"https://github.com/0xleif/scribe","last_synced_at":"2025-07-18T16:37:39.787Z","repository":{"id":83170906,"uuid":"595416416","full_name":"0xLeif/Scribe","owner":"0xLeif","description":"📜 Logging all events","archived":false,"fork":false,"pushed_at":"2023-08-17T18:23:05.000Z","size":26,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T18:46:07.069Z","etag":null,"topics":["async-await","ios","log","logging","macos","plugin","plugins","swift","swift-log","watchos"],"latest_commit_sha":null,"homepage":"https://scribe.0xl.io/","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/0xLeif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-31T02:56:11.000Z","updated_at":"2025-06-07T15:29:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"701626d4-8dec-4904-9fa7-3a8b6d70420e","html_url":"https://github.com/0xLeif/Scribe","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/0xLeif/Scribe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FScribe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FScribe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FScribe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FScribe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xLeif","download_url":"https://codeload.github.com/0xLeif/Scribe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FScribe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265793684,"owners_count":23829180,"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":["async-await","ios","log","logging","macos","plugin","plugins","swift","swift-log","watchos"],"created_at":"2024-10-31T04:10:01.344Z","updated_at":"2025-07-18T16:37:39.764Z","avatar_url":"https://github.com/0xLeif.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scribe\n\n*📜 Logging all events*\n\nScribe is a flexible logging library for Swift, designed to make logging easy and efficient. It provides a centralized system for logging messages and events within your application, and supports multiple logging outputs and plugins to extend its capabilities to meet your needs. Scribe integrates with [swift-log](https://github.com/apple/swift-log) for console logging, making it a versatile solution for all your logging requirements.\n\n## Usage\n\n### Creating a ScribePlugin\n\nTo create a Scribe plugin, you need to create a struct or class that conforms to the ScribePlugin protocol and implement its requirements. Here is an example of a simple plugin that increments a count for each log:\n\n```swift\nclass CountPlugin: ScribePlugin {\n    static let shared = CountPlugin()\n\n    var count: Int = 0\n\n    private init() {}\n\n    func handle(value: Scribe.PluginPayload) async throws {\n        count += 1\n    }\n}\n```\n\n### Registering plugins to Scribe\n\nOnce you have created your Scribe Plugin, you just need to register it with your Scribe object. There are two ways to do this:\n\n1. Pass the plugin to the plugins parameter when creating the Scribe object:\n\n```swift\nlet scribe = Scribe(\n    label: \"test.count\",\n    plugins: [\n        CountPlugin.shared\n    ]\n)\n```\n        \n2. Call `scribe.register(plugin:)` to add the plugin to an existing Scribe object:\n\n```swift\nlet scribe = Scribe(label: \"test.count\")\n\nscribe.register(plugin: CountPlugin.shared)\n```\n\n### Logging to Scribe\n\nScribe uses swift-log for logging, so the functions are similar in usage. To log a message with Scribe, simply call one of the logging functions, such as debug:\n\n```swift\nscribe.debug(\"Test\")\n```\n\n#### Log Levels\n\nScribe supports the following log levels:\n\n- `trace`\n- `debug`\n- `info`\n- `notice`\n- `warning`\n- `error`\n- `critical`\n\nChoose the appropriate log level depending on the importance and urgency of the message you are logging.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fscribe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xleif%2Fscribe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fscribe/lists"}