{"id":28467825,"url":"https://github.com/kitura/heliumlogger","last_synced_at":"2025-10-12T03:17:12.809Z","repository":{"id":46649957,"uuid":"51111646","full_name":"Kitura/HeliumLogger","owner":"Kitura","description":"A lightweight logging framework for Swift","archived":false,"fork":false,"pushed_at":"2021-10-01T16:54:10.000Z","size":1088,"stargazers_count":177,"open_issues_count":3,"forks_count":39,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-10-02T16:04:52.406Z","etag":null,"topics":["log","logger","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kitura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-04T22:52:38.000Z","updated_at":"2025-07-29T07:30:55.000Z","dependencies_parsed_at":"2022-08-30T00:40:25.341Z","dependency_job_id":null,"html_url":"https://github.com/Kitura/HeliumLogger","commit_stats":null,"previous_names":["ibm-swift/heliumlogger"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/Kitura/HeliumLogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FHeliumLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FHeliumLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FHeliumLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FHeliumLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kitura","download_url":"https://codeload.github.com/Kitura/HeliumLogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FHeliumLogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010176,"owners_count":26084691,"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-10-12T02:00:06.719Z","response_time":53,"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":["log","logger","logging","swift"],"created_at":"2025-06-07T08:05:36.492Z","updated_at":"2025-10-12T03:17:12.805Z","avatar_url":"https://github.com/Kitura.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://kitura.io/\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/Kitura/Kitura/master/Sources/Kitura/resources/kitura-bird.svg?sanitize=true\" height=\"100\" alt=\"Kitura\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://kitura.github.io/HeliumLogger/index.html\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/apidoc-HeliumLogger-1FBCE4.svg?style=flat\" alt=\"APIDoc\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/Kitura/HeliumLogger\"\u003e\n    \u003cimg src=\"https://travis-ci.org/Kitura/HeliumLogger.svg?branch=master\" alt=\"Build Status - Master\"\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://codecov.io/gh/Kitura/HeliumLogger/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/os-macOS-green.svg?style=flat\" alt=\"macOS\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/os-linux-green.svg?style=flat\" alt=\"Linux\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache2-blue.svg?style=flat\" alt=\"Apache 2\"\u003e\n    \u003ca href=\"http://swift-at-ibm-slack.mybluemix.net/\"\u003e\n    \u003cimg src=\"http://swift-at-ibm-slack.mybluemix.net/badge.svg\" alt=\"Slack Status\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# HeliumLogger\n\nProvides a lightweight logging implementation for Swift which logs to standard output.\n\n## Features\n\n- Logs output to stdout by default. You can change the output stream, see example usage for [`HeliumStreamLogger.use(_:outputStream:)`](http://kitura.github.io/HeliumLogger/Classes/HeliumStreamLogger.html#use).\n- Different logging levels such as Warning, Verbose, and Error\n- Enable/disable color output to terminal \n- Support for the [Kitura `LoggerAPI`](https://github.com/Kitura/LoggerAPI) and [Swift-log `Logging`](https://github.com/apple/swift-log) logging APIs.\n\n## Usage\n\n#### Add dependencies\n\nAdd the `HeliumLogger` package to the dependencies within your application’s `Package.swift` file. Substitute `\"x.x.x\"` with the latest `HeliumLogger` [release](https://github.com/Kitura/HeliumLogger/releases).\n\n```swift\n.package(url: \"https://github.com/Kitura/HeliumLogger.git\", from: \"x.x.x\")\n```\n\nAdd `HeliumLogger` to your target's dependencies:\n\n```swift\n.target(name: \"example\", dependencies: [\"HeliumLogger\"]),\n```\n#### Import packages\n\nTo use with LoggerAPI:\n\n```swift\nimport HeliumLogger\nimport LoggerAPI\n```\n\nTo use with swift-log:\n```swift\nimport HeliumLogger\nimport Logging\n```\n\n#### Initialize HeliumLogger\n\nTo use HeliumLogger as a logging backend for LoggerAPI:\n\n```swift\nlet logger = HeliumLogger()\nLog.logger = logger\n```\n\nor, if you don't need to customize `HeliumLogger`:\n```swift\nHeliumLogger.use()\n```\n\nTo use HeliumLogger as a logging backend for swift-log:\n\n```swift\nlet logger = HeliumLogger()\nLoggingSystem.bootstrap(logger.makeLogHandler)\n```\n\nOr, as a convenience:\n```swift\nHeliumLogger.bootstrapSwiftLog()\n```\n\n\n#### Logging levels\n\nYou can specify the level of output on initialization. You will see output of that level, and all levels below that.\n\nThe order is:\n 1. entry (entering a function)\n 2. exit (exiting a function)\n 3. debug\n 4. verbose (default)\n 5. info\n 6. \u0026#32;warning\n 7. error\n\nFor example, this logger will show messages of type `verbose`, `info`, `warning`, and `error`:\n```swift\nlet logger = HeliumLogger(.verbose)\nLog.logger = logger\n```\n\nIn this example, the logger will only show messages of type `warning` and `error`:\n```swift\nHeliumLogger.use(.warning)\n```\n\nNote that when HeliumLogger is used in conjunction with swift-log, the logging level is determined by the `Logger`, and HeliumLogger's own logging level is unused.\n\n#### Adjust logging levels at runtime (LoggerAPI)\n\nCalling `HeliumLogger.use(LoggerMessageType)` will set the `LoggerAPI` to use this new HeliumLogger instance. If in a route you detect an error with your application, you could use this to dynamically increase the log level.\n\nThis new instance will not have any customization which you applied to other instances (see list item 7).\n\n#### Logging messages (LoggerAPI)\n\nHow to use HeliumLogger to log messages in your application with LoggerAPI:\n```swift\nLog.verbose(\"This is a verbose log message.\")\n\nLog.info(\"This is an informational log message.\")\n\nLog.warning(\"This is a warning.\")\n\nLog.error(\"This is an error.\")\n\nLog.debug(\"This is a debug message.\")\n```\n\n#### Further customization\n\n```swift\n/// Whether, if true, or not the logger output should be colorized.\npublic var colored: Bool = false\n\n/// If true, use the detailed format when a user logging format wasn't specified.\npublic var details: Bool = true\n\n/// If true, use the full file path, not just the filename.\npublic var fullFilePath: Bool = false\n\n/// If not nil, specifies the user specified logging format.\n/// For example: \"[(%date)] [(%type)] [(%file):(%line) (%func)] (%msg)\"\npublic var format: String?\n\n/// If not nil, specifies the format used when adding the date and the time to the logged messages.\npublic var dateFormat: String?\n\n/// If not nil, specifies the timezone used in the date time format.\npublic var timeZone: TimeZone?\n```\n\n## API documentation\n\nFor more information visit our [API reference](http://kitura.github.io/HeliumLogger/).\n\n## Community\n\nWe love to talk server-side Swift, and Kitura. Join our [Slack](http://swift-at-ibm-slack.mybluemix.net/) to meet the team!\n\n## License\n\nThis library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/Kitura/HeliumLogger/blob/master/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitura%2Fheliumlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitura%2Fheliumlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitura%2Fheliumlogger/lists"}