{"id":16473293,"url":"https://github.com/amalfra/recorder","last_synced_at":"2025-03-23T11:32:50.811Z","repository":{"id":57606046,"uuid":"99477735","full_name":"amalfra/recorder","owner":"amalfra","description":"A go package to capture stdout and stderr generated by your code :camera:","archived":false,"fork":false,"pushed_at":"2024-04-09T11:25:58.000Z","size":25,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-18T20:07:44.322Z","etag":null,"topics":["capture","go","golang","stderr","stdout"],"latest_commit_sha":null,"homepage":"","language":"Go","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/amalfra.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}},"created_at":"2017-08-06T09:52:52.000Z","updated_at":"2023-11-15T00:02:25.000Z","dependencies_parsed_at":"2024-04-09T12:39:33.577Z","dependency_job_id":"638ef12b-2397-48a9-8894-210ac1b3cc74","html_url":"https://github.com/amalfra/recorder","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Frecorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Frecorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Frecorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amalfra%2Frecorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amalfra","download_url":"https://codeload.github.com/amalfra/recorder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097158,"owners_count":20560311,"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":["capture","go","golang","stderr","stdout"],"created_at":"2024-10-11T12:26:10.479Z","updated_at":"2025-03-23T11:32:50.512Z","avatar_url":"https://github.com/amalfra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"recorder\n========\n[![GitHub release](https://img.shields.io/github/release/amalfra/recorder.svg)](https://github.com/amalfra/recorder/releases)\n![Build Status](https://github.com/amalfra/recorder/actions/workflows/test.yml/badge.svg?branch=main)\n[![GoDoc](https://godoc.org/github.com/amalfra/recorder/v3?status.svg)](https://godoc.org/github.com/amalfra/recorder/v3)\n[![Go Report Card](https://goreportcard.com/badge/github.com/amalfra/recorder/v3)](https://goreportcard.com/report/github.com/amalfra/recorder/v3)\n[![Coverage Status](https://coveralls.io/repos/github/amalfra/recorder/badge.svg?branch=main)](https://coveralls.io/github/amalfra/recorder?branch=main)\n\nA go package to capture stdout and stderr generated by your code\n\n## Installation\nYou can download the package using\n```sh\ngo get github.com/amalfra/recorder/v3\n```\n## Usage\nNext, import the package\n``` go\nimport (\n  \"github.com/amalfra/recorder/v3\"\n)\n```\nYou can record output from both Stdout as well as Stderr. The recorded output will be available as string. The following two structs are available for your use:\n* recorder.Stdout - Can be used for recording from Stdout\n* recorder.Stderr - Can be used for recording from Stderr\n\nThere are four struct methods which can be used to control recording process:\n* Start - To start recording\n* Stop - To stop recording\n* GetOutput - To return recorded output as string\n* ClearOutput - To clear the recorded output\n\nTo record follow below steps:\n\n1. first create the instance of struct as follows:\n```go\nrec := new(recorder.Stdout)\n```\nor if to record from Stderr do\n```go\nrec := new(recorder.Stderr)\n```\n\n2. Now call the ```Start``` method as follows:\n```go\nrec.Start()\n```\nFrom now onwards all Stdout or Stderr output will be captured.\n\n3. Call ```Stop``` method as follows when you want to stop recording process:\n```go\nrec.Stop()\n```\n\n4. Now get the recorded output by calling the ```GetOutput``` method. It will return the recorded output string\n```go\nout := rec.GetOutput()\n```\n\n## Development\n\nQuestions, problems or suggestions? Please post them on the [issue tracker](https://github.com/amalfra/recorder/issues).\n\nYou can contribute changes by forking the project and submitting a pull request. You can ensure the tests are passing by running ```make test```. Feel free to contribute :heart_eyes:\n\n## UNDER MIT LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Amal Francis\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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalfra%2Frecorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famalfra%2Frecorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalfra%2Frecorder/lists"}