{"id":13413322,"url":"https://github.com/arthurkiller/rollingWriter","last_synced_at":"2025-03-14T19:31:57.377Z","repository":{"id":37390818,"uuid":"81722987","full_name":"arthurkiller/rollingwriter","owner":"arthurkiller","description":"Rolling writer is an IO util for auto rolling write in go.","archived":false,"fork":false,"pushed_at":"2023-10-16T06:38:26.000Z","size":303,"stargazers_count":295,"open_issues_count":9,"forks_count":45,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-22T20:34:16.092Z","etag":null,"topics":["filewriter","golang-library","ioutil","rotate","rotatelog"],"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/arthurkiller.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}},"created_at":"2017-02-12T12:05:26.000Z","updated_at":"2024-06-28T14:41:18.000Z","dependencies_parsed_at":"2024-01-08T15:34:40.213Z","dependency_job_id":null,"html_url":"https://github.com/arthurkiller/rollingwriter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Frollingwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Frollingwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Frollingwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkiller%2Frollingwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurkiller","download_url":"https://codeload.github.com/arthurkiller/rollingwriter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221498731,"owners_count":16833055,"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":["filewriter","golang-library","ioutil","rotate","rotatelog"],"created_at":"2024-07-30T20:01:37.689Z","updated_at":"2024-10-26T05:30:43.502Z","avatar_url":"https://github.com/arthurkiller.png","language":"Go","readme":"# RollingWriter [![Build Status](https://travis-ci.org/arthurkiller/rollingWriter.svg?branch=master)](https://travis-ci.org/arthurkiller/rollingWriter) [![Go Report Card](https://goreportcard.com/badge/github.com/arthurkiller/rollingwriter)](https://goreportcard.com/report/github.com/arthurkiller/rollingwriter) [![GoDoc](https://godoc.org/github.com/arthurkiller/rollingWriter?status.svg)](https://godoc.org/github.com/arthurkiller/rollingWriter) [![codecov](https://codecov.io/gh/arthurkiller/rollingwriter/branch/master/graph/badge.svg)](https://codecov.io/gh/arthurkiller/rollingwriter) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#logging)\nRollingWriter is an auto rotate `io.Writer` implementation. It can works well with logger.\n\n__Awesome Go popular log helper__\n\n__New Version v2.0 is comming out! Much more Powerfull and Efficient. Try it by follow the demo__\n\nRollingWriter contains 2 separate patrs:\n* Manager: decide when to rotate the file with policy. RlingPolicy give out the rolling policy\n    * WithoutRolling: no rolling will happen\n    * TimeRolling: rolling by time\n    * VolumeRolling: rolling by file size\n\n* IOWriter: impement the io.Writer and do the io write\n    * Writer: not parallel safe writer\n    * LockedWriter: parallel safe garented by lock\n    * AsyncWtiter: parallel safe async writer\n    * BufferWriter: merge serval write into one `file.Write()`\n\n## Features\n* Auto rotate with multi rotate policies\n* Implement go io.Writer, provide parallel safe writer\n* Max remain rolling files with auto cleanup\n* Easy for user to implement your manager\n\n## Benchmark\n```bash\ngoos: darwin\ngoarch: amd64\npkg: github.com/arthurkiller/rollingWriter\nBenchmarkWrite-4                          300000              5952 ns/op               0 B/op          0 allocs/op\nBenchmarkParallelWrite-4                  200000              7846 ns/op               0 B/op          0 allocs/op\nBenchmarkAsynWrite-4                      200000              7917 ns/op           16324 B/op          1 allocs/op\nBenchmarkParallelAsynWrite-4              200000              8632 ns/op           12513 B/op          1 allocs/op\nBenchmarkLockedWrite-4                    200000              5829 ns/op               0 B/op          0 allocs/op\nBenchmarkParallelLockedWrite-4            200000              7796 ns/op               0 B/op          0 allocs/op\nBenchmarkBufferWrite-4                    200000              6943 ns/op            1984 B/op          4 allocs/op\nBenchmarkParallelBufferWrite-4           1000000              1026 ns/op            7129 B/op          1 allocs/op\nPASS\nok      github.com/arthurkiller/rollingWriter   14.867s\n```\n\n## Quick Start\n```golang\n\twriter, err := rollingwriter.NewWriterFromConfig(\u0026config)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\twriter.Write([]byte(\"hello, world\"))\n```\nWant more? View `demo` for more details.\n\nAny suggestion or new feature inneed, please [put up an issue](https://github.com/arthurkiller/rollingWriter/issues/new)\n","funding_links":[],"categories":["Logging","Logging 日志库","日志记录"],"sub_categories":["Search and Analytic Databases","SQL 查询语句构建库","检索及分析资料库","Advanced Console UIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkiller%2FrollingWriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurkiller%2FrollingWriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkiller%2FrollingWriter/lists"}