{"id":20819970,"url":"https://github.com/elo7/nayau","last_synced_at":"2025-06-27T19:36:24.749Z","repository":{"id":46453982,"uuid":"55997750","full_name":"elo7/Nayau","owner":"elo7","description":"A production/debug logger for you Swift Project","archived":false,"fork":false,"pushed_at":"2021-10-11T16:52:09.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":61,"default_branch":"master","last_synced_at":"2025-03-12T06:19:51.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elo7.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":"2016-04-11T18:40:43.000Z","updated_at":"2021-10-11T16:49:04.000Z","dependencies_parsed_at":"2022-09-23T01:12:14.287Z","dependency_job_id":null,"html_url":"https://github.com/elo7/Nayau","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/elo7/Nayau","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2FNayau","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2FNayau/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2FNayau/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2FNayau/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elo7","download_url":"https://codeload.github.com/elo7/Nayau/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2FNayau/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262319664,"owners_count":23293064,"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":[],"created_at":"2024-11-17T22:07:57.106Z","updated_at":"2025-06-27T19:36:24.725Z","avatar_url":"https://github.com/elo7.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Nayau\n*A production/debug logger for you Swift Project*\n\n## Requirements\n- iOS 11.0+\n- Swift 5.0\n- Xcode 8.0+\n\n## Instalation\nEmbedded frameworks require a minimum deployment target of iOS 11.\n\n### Carthage\n```\ngithub \"elo7/nayau\" \"master\"\n```\n\nAnd add the path to the framework under “Input Files”, e.g.:\n\n```\n$(SRCROOT)/Carthage/Build/iOS/nayau.framework\n```\n\n### Swift Package Manager (SPM)\n\nThe Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. To integrate using Apple's Swift package manager from xcode :\n\nFile -\u003e Add Packages... -\u003e Enter package URL : https://github.com/elo7/Nayau, choose the latest release\n\n## Getting started\nFirst of all, you shall setup your debug/release flags, it's quite simple. \"Set it in the Swift Compiler - Custom Flags section, 'Other Swift Flags' line. Just Add `-D DEBUG`. If you are having problems with that, look [that Stack Overflow question](http://stackoverflow.com/questions/24111854/in-absence-of-preprocessor-macros-is-there-a-way-to-define-practical-scheme-spe).\n\nAnd paste that code block in your setup area, it's the simple way that we found to know if your applications is in debug or release mode.\n```swift\nfunc isDebug() -\u003e Bool {\n    #if DEBUG\n        return true\n    #else\n        return false\n    #endif\n}\n```\n\nFinally you can setup your Nayau:\n```swift\nimport nayau\n\nNayau.setup(debugBuild: YourClass().isDebug())\n\nNayau.debug(\"A debug message\")\n#=\u003e A debug message \n\nNayay.debug(\"A error message in debug mode\", logType: LogType.Error)\n#=\u003e [Error] : A error message in debug mode\n\nNayau.production(\"A production message\")\n#=\u003e A production message \n\nNayau.production(\"A error message in production mode\", logType: LogType.Error) {\n#=\u003e [Error] : A error message in production mode\n```\n\n### Enable file information\nIf you want to see file that logging information, just enable that in the Nayau setup method:\n```swift\nimport nayau\n\nNayau.setup(enableFileName: true, debugBuild: YourClass().isDebug())\n\nNayau.debug(\"A debug message\")\n#=\u003e A debug message FileInformation: File: yourPath/YourFile.swift Line Number: 61 Function: xablau()\n\nNayau.production(\"A production message\")\n#=\u003e A production message FileInformation: File: yourPath/YourFile.swift Line Number: 61 Function: xablau()\n```\n\n### Compute information in Debug\nIf you want to compute something heavy to process, you can use Nayau with trailing closure, and that heavy compute will execute just in debug:\n```swift\nNayau.debug {\n    let xablau = [ \"this\" , \"message\" , \"concat\" , \"is\" , \"just\" , \"necessary\" , \"in\" , \"debug\" , \"mode\" ]\n\n    return xablau.map {\n        $0.uppercaseString\n    }\n}\n```\n\n## Why Nayau?\nSometimes, we (developers) need to debug our developing applications, with that in mind, we built a simple tool that can help you with your debug/production log. When you need to print some information/data just for test/follow flow of your application, use `debug` instance method from Nayau, when you need to print something in released apps, use `production` instance method from Nayau. Quite simple :)\n\n## Contribute\n- If you **found a bug**, open an issue.\n- If you ***have a feature request***, open an issue.\n- If you ***want to contribute***, submit a pull request\n\n## License\nNayau is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Fnayau","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felo7%2Fnayau","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Fnayau/lists"}