{"id":21585980,"url":"https://github.com/magiclen/pipe-logger-lib","last_synced_at":"2025-07-02T13:39:00.173Z","repository":{"id":46684953,"uuid":"148506867","full_name":"magiclen/pipe-logger-lib","owner":"magiclen","description":"Stores, rotates, compresses process logs.","archived":false,"fork":false,"pushed_at":"2023-09-09T12:22:09.000Z","size":38,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T17:57:37.011Z","etag":null,"topics":["pipe-logger","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/magiclen.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,"zenodo":null}},"created_at":"2018-09-12T16:06:29.000Z","updated_at":"2021-10-16T02:53:24.000Z","dependencies_parsed_at":"2025-04-10T20:14:56.373Z","dependency_job_id":"d79f8cb2-289b-4443-b80f-563b249a7544","html_url":"https://github.com/magiclen/pipe-logger-lib","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/magiclen/pipe-logger-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fpipe-logger-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fpipe-logger-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fpipe-logger-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fpipe-logger-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/pipe-logger-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fpipe-logger-lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259827731,"owners_count":22917728,"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":["pipe-logger","rust"],"created_at":"2024-11-24T15:12:18.573Z","updated_at":"2025-07-02T13:39:00.128Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pipe Logger Lib\n====================\n\n[![CI](https://github.com/magiclen/pipe-logger-lib/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/pipe-logger-lib/actions/workflows/ci.yml)\n\nStores, rotates, compresses process logs.\n\n## Example\n\n```rust\nuse pipe_logger_lib::*;\n\nuse std::fs;\nuse std::path::Path;\n\nlet test_folder = {\n  let folder = Path::join(\u0026Path::join(Path::new(\"tests\"), Path::new(\"out\")), \"log-example\");\n\n  fs::remove_dir_all(\u0026folder);\n\n  fs::create_dir_all(\u0026folder).unwrap();\n\n  folder\n};\n\nlet test_log_file = Path::join(\u0026test_folder, Path::new(\"mylog.txt\"));\n\nlet mut builder = PipeLoggerBuilder::new(\u0026test_log_file);\n\nbuilder\n    .set_tee(Some(Tee::Stdout))\n    .set_rotate(Some(RotateMethod::FileSize(30))) // bytes\n    .set_count(Some(10))\n    .set_compress(false);\n\n{\n    let mut logger = builder.build().unwrap();\n\n    logger.write_line(\"Hello world!\").unwrap();\n\n    let rotated_log_file_1 = logger.write_line(\"This is a convenient logger.\").unwrap().unwrap();\n\n    logger.write_line(\"Other logs...\").unwrap();\n    logger.write_line(\"Other logs...\").unwrap();\n\n    let rotated_log_file_2 = logger.write_line(\"Rotate again!\").unwrap().unwrap();\n\n    logger.write_line(\"Ops!\").unwrap();\n}\n\nfs::remove_dir_all(test_folder).unwrap();\n```\n\nNow, the contents of `test_log_file` are,\n\n```text\nOps!\n```\n\nThe contents of `rotated_log_file_1` are,\n\n```text\nHello world!\nThis is a convenient logger.\n```\n\nThe contents of `rotated_log_file_2` are,\n\n```text\nOther logs...\nOther logs...\nRotate again!\n```\n\n## Crates.io\n\nhttps://crates.io/crates/pipe-logger-lib\n\n## Documentation\n\nhttps://docs.rs/pipe-logger-lib\n\n## Official CLI\n\nhttps://crates.io/crates/pipe-logger\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fpipe-logger-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fpipe-logger-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fpipe-logger-lib/lists"}