{"id":20565266,"url":"https://github.com/juanjoarreola/logg","last_synced_at":"2025-07-07T04:10:23.189Z","repository":{"id":56920082,"uuid":"88684531","full_name":"JuanjoArreola/Logg","owner":"JuanjoArreola","description":"Logger for swift","archived":false,"fork":false,"pushed_at":"2020-09-03T15:26:40.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T01:04:40.049Z","etag":null,"topics":["logging","swift"],"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/JuanjoArreola.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}},"created_at":"2017-04-19T01:01:17.000Z","updated_at":"2020-09-09T16:21:26.000Z","dependencies_parsed_at":"2022-08-21T04:20:18.099Z","dependency_job_id":null,"html_url":"https://github.com/JuanjoArreola/Logg","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/JuanjoArreola/Logg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuanjoArreola%2FLogg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuanjoArreola%2FLogg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuanjoArreola%2FLogg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuanjoArreola%2FLogg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuanjoArreola","download_url":"https://codeload.github.com/JuanjoArreola/Logg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuanjoArreola%2FLogg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264010960,"owners_count":23543717,"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","swift"],"created_at":"2024-11-16T04:33:40.392Z","updated_at":"2025-07-07T04:10:23.173Z","avatar_url":"https://github.com/JuanjoArreola.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A logging framework for swift\n\n![Cocoapods](https://img.shields.io/cocoapods/v/Logg.svg)\n![Platform](https://img.shields.io/cocoapods/p/Logg.svg)\n![License](https://img.shields.io/cocoapods/l/Logg.svg)\n\n## Usage\n\n```swift\nlogger.info(\"Current loggers: \\(Log.loggers)\")\nlogger.debug(\"Using formatter: \\(Log.loggers.first!.formatter)\")\nlogger.error(TestError.invalid)\nlogger.fault(\"some error\")\n```\n###### Prints:\n```\n04-21 13:04:30.040 LoggTests.swift testFileLogger() [14] ❕ Info: Current loggers: [Logg.ConsoleLogger]\n04-21 13:04:30.041 LoggTests.swift testFileLogger() [15] 🐛 Debug: Using formatter: Logg.DefaultFormatter\n04-21 13:04:30.041 LoggTests.swift testFileLogger() [16] ❗ Error: invalid\n04-21 13:04:30.041 LoggTests.swift testFileLogger() [17] ‼️ Fault: some error\n```\n\n## Configuration\n\n`Log` is the class that dispatch the messages to all the loggers, you can configure this loggers modifying the loggers static property:\n\n```swift\nif debug {\n  Log.loggers = [ConsoleLogger()]\n} else {\n  Log.loggers = [CustomLogger(level: [.error, .severe])]\n}\n```\n\nEach logger has a property named level that you can customize:\n\n```swift\nlet consoleLogger = Log.loggers.first\nconsoleLogger?.level = [.debug, .warning]\n```\n\nThe level is an `OptionSet` with 4 basic values: `debug`, `warning`, `error`, `severe` and additionally `all` and `none`\n\n## Logger\n\nYou can create and register your own loggers, just implement the `Logger` protocol and add an instance to the `loggers` static property of the `Log` class. The `Logger` protocol defines a couple of properties, `level` and `formatter`, and four functions: `debug, warn, error` and `severe` that correspond to the log levels\n\n## Formatter\n\nYou can create your own formatter and use it with the loggers you want, just create a class that implements the `Formatter` protocol and assign it to the logger\n\n```swift\nlet consoleLogger = Log.loggers.first\nconsoleLogger?.formatter = CustomFormatter()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanjoarreola%2Flogg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanjoarreola%2Flogg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanjoarreola%2Flogg/lists"}