{"id":1336,"url":"https://github.com/delba/Log","last_synced_at":"2025-08-02T04:30:48.334Z","repository":{"id":56919974,"uuid":"47777190","full_name":"delba/Log","owner":"delba","description":"An extensible logging framework for Swift","archived":false,"fork":false,"pushed_at":"2019-11-16T19:48:21.000Z","size":269,"stargazers_count":832,"open_issues_count":4,"forks_count":62,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-25T20:45:19.535Z","etag":null,"topics":[],"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/delba.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":"2015-12-10T17:32:32.000Z","updated_at":"2025-03-19T09:52:56.000Z","dependencies_parsed_at":"2022-08-21T04:20:20.770Z","dependency_job_id":null,"html_url":"https://github.com/delba/Log","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/delba/Log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delba%2FLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delba%2FLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delba%2FLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delba%2FLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delba","download_url":"https://codeload.github.com/delba/Log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delba%2FLog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334606,"owners_count":24233793,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:15:44.102Z","updated_at":"2025-08-02T04:30:48.067Z","avatar_url":"https://github.com/delba.png","language":"Swift","funding_links":[],"categories":["Logging","Swift","Libs"],"sub_categories":["Other Hardware","Other free courses","Logging"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/delba/Log/assets/Logo@2x.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://travis-ci.org/delba/Log\"\u003e\u003cimg alt=\"Travis Status\" src=\"https://img.shields.io/travis/delba/Log.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://img.shields.io/cocoapods/v/Log.svg\"\u003e\u003cimg alt=\"CocoaPods compatible\" src=\"https://img.shields.io/cocoapods/v/Log.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg alt=\"Carthage compatible\" src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://img.shields.io/cocoapods/p/Log.svg\"\u003e\u003cimg alt=\"Platform\" src=\"https://img.shields.io/cocoapods/p/Log.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`Log` is a powerful logging framework that provides built-in themes and formatters, and a nice API to define your owns.\n\n\u003e Get the most out of `Log` by installing [`XcodeColors`](https://github.com/robbiehanson/XcodeColors) and [`KZLinkedConsole`](https://github.com/krzysztofzablocki/KZLinkedConsole)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e • \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e • \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n### Usage\n\n#### The basics\n\n- Use `Log` just as you would use `print`.\n\n```swift\nlet Log = Logger()\n\nLog.trace(\"Called!!!\")\nLog.debug(\"Who is self:\", self)\nLog.info(some, objects, here)\nLog.warning(one, two, three, separator: \" - \")\nLog.error(error, terminator: \"😱😱😱\\n\")\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/delba/Log/assets/a.png\"\u003e\n\n- Disable `Log` by setting `enabled` to `false`:\n\n```swift\nLog.enabled = false\n```\n\n- Define a minimum level of severity to only print the messages with a greater or equal severity:\n\n```swift\nLog.minLevel = .warning\n```\n\n\u003e The severity levels are `trace`, `debug`, `info`, `warning`, and `error`.\n\n#### Customization\n\n- Create your own `Logger` by changing its `Theme` and/or `Formatter`.\n\nA suggested way of doing it is by extending `Formatters` and `Themes`:\n\n```swift\nextension Formatters {\n    static let detailed = Formatter(\"[%@] %@.%@:%@ %@: %@\", [\n        .date(\"yyyy-MM-dd HH:mm:ss.SSS\"),\n        .file(fullPath: false, fileExtension: false),\n        .function,\n        .line,\n        .level,\n        .message\n    ])\n}\n\nextension Themes {\n    static let tomorrowNight = Theme(\n        trace:   \"#C5C8C6\",\n        debug:   \"#81A2BE\",\n        info:    \"#B5BD68\",\n        warning: \"#F0C674\",\n        error:   \"#CC6666\"\n    )\n}\n```\n\n```swift\nlet Log = Logger(formatter: .detailed, theme: .tomorrowNight)\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/delba/Log/assets/b.png\"\u003e\n\n\u003e See the built-in [formatters](https://github.com/delba/Log/blob/master/Source/Extensions/Formatters.swift) and [themes](https://github.com/delba/Log/blob/master/Source/Extensions/Themes.swift) for more examples.\n\n**Tip:** `Log.format` and `Log.colors` can be useful to visually debug your logger.\n\nNothing prevents you from creating as many loggers as you want!\n\n```swift\nlet Basic = Logger(formatter: .default, theme: nil)\nlet Short = Logger(\n    formatter: Formatter(\"%@: %@\", .level, .message),\n    theme:     .tomorrowNightEighties,\n    minLevel:  .info\n)\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/delba/Log/assets/c.png\"\u003e\n\n- Turn off the colors by setting the theme to `nil`:\n\n```swift\nLog.theme = nil\n```\n\n#### Advanced\n\nInclude a custom `Block` component in your formatter to print its result in every log message: \n\n```swift\nstruct User {\n    static func token() -\u003e Int {\n        return NSUserDefaults.standardUserDefaults.integerForKey(\"token\")\n    }\n}\n\nLog.formatter = Formatter(\"[%@] %@: %@\", .block(User.token), .level, .message)\n```\n\n## Installation\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Log into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"delba/Log\"\n```\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.\n\nYou can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate Log into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nuse_frameworks!\n\npod 'Log'\n```\n\n## License\n\nCopyright (c) 2015-2016 Damien (http://delba.io)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelba%2FLog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelba%2FLog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelba%2FLog/lists"}