{"id":17644436,"url":"https://github.com/vigna/dsi-progress-logger-rs","last_synced_at":"2026-04-03T09:02:16.594Z","repository":{"id":165552403,"uuid":"640910207","full_name":"vigna/dsi-progress-logger-rs","owner":"vigna","description":"A Rust port of the ProgressLogger class from the DSI Utilities","archived":false,"fork":false,"pushed_at":"2024-03-25T07:54:49.000Z","size":48,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-25T20:44:54.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/vigna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-Apache-2.0","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":"2023-05-15T11:37:27.000Z","updated_at":"2024-07-31T18:43:02.108Z","dependencies_parsed_at":null,"dependency_job_id":"49b9c4fa-a39c-4b2d-b5b6-77a4ad711d29","html_url":"https://github.com/vigna/dsi-progress-logger-rs","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/vigna%2Fdsi-progress-logger-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigna%2Fdsi-progress-logger-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigna%2Fdsi-progress-logger-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vigna%2Fdsi-progress-logger-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vigna","download_url":"https://codeload.github.com/vigna/dsi-progress-logger-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252797694,"owners_count":21805755,"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-10-23T10:05:28.213Z","updated_at":"2026-04-03T09:02:16.589Z","avatar_url":"https://github.com/vigna.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSI Progress Logger\n\n[![crates.io](https://img.shields.io/crates/v/dsi-progress-logger.svg)](https://crates.io/crates/dsi-progress-logger)\n[![docs.rs](https://docs.rs/dsi-progress-logger/badge.svg)](https://docs.rs/dsi-progress-logger)\n[![rustc](https://img.shields.io/badge/rustc-1.85+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)\n[![CI](https://github.com/vigna/dsi-progress-logger-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/vigna/dsi-progress-logger-rs/actions)\n![license](https://img.shields.io/crates/l/dsi-progress-logger)\n[![downloads](https://img.shields.io/crates/d/dsi-progress-logger)](https://crates.io/crates/dsi-progress-logger)\n\nA tunable time-based progress logger to log progress information about long-running\nactivities.\n\nIt is a port of the Java class [`it.unimi.dsi.util.ProgressLogger`] from the\n[DSI Utilities], with new features such as concurrent updates. Logging is based\non the standard [`log`] crate, defaulting to the `info` level.\n\nThere is a [`ProgressLog`] trait and a default implementation\n[`ProgressLogger`].\n\n## Concurrent Logging\n\nIf you need to log progress from multiple threads, you can use a\n[`ConcurrentProgressLog`], which is obtained, for example,  by wrapping a\n[`ProgressLog`] implementation using a [`ConcurrentWrapper`].\n\n[`ConcurrentProgressLog`] extends [`ProgressLog`], but when you clone a\n[`ConcurrentProgressLog`] you obtain a new [`ConcurrentProgressLog`], based on\nthe same underlying [`ProgressLog`], that can be passed to other threads. As a\nresult, a [`ConcurrentProgressLog`] can be used with methods like\n[`rayon::ParallelIterator::for_each_with`](https://docs.rs/rayon/latest/rayon/iter/trait.ParallelIterator.html#method.for_each_with),\n[`rayon::ParallelIterator::map_with`](https://docs.rs/rayon/latest/rayon/iter/trait.ParallelIterator.html#method.map_with),\nand so on (but in this case do not use the [`display_memory`] method if another\ncrate in your compilation unit depends on\n[`sysinfo`](https://crates.io/crates/sysinfo)'s (default) `multithread` feature,\nas [this can lead to a deadlock](https://github.com/rayon-rs/rayon/issues/592)).\nConvenience constructors and macros make concurrent progress logging as easy as\nsingle-threaded logging.\n\n## Optional Logging\n\nThis crate supports optional logging by implementing [`ProgressLog`] for\n`Option\u003cProgressLog\u003e::None` as a no-op. As a result, you can pass to functions\nan argument `pl` that is a `\u0026mut impl ProgressLog`, with the following behavior:\n\n- if you pass a `\u0026mut ProgressLogger`, the progress logger will be used, without\n  any check;\n- if you pass a `\u0026mut Option::\u003cProgressLogger\u003e::None`, no logging will be\n  performed, and in fact the logging code should be entirely optimized away by\n  the compiler; the macro [`no_logging!`] can be used a convenient way to switch\n  off logging;\n- if you pass an `\u0026mut Option\u003cProgressLogger\u003e`, logging will happen depending on\n  the variant, and there will be a runtime check for each call.\n\nAll of the above applies to [`ConcurrentProgressLog`], too. Moreover, the\n[`ProgressLog::concurrent`] method can be used to obtain a\n[`ConcurrentProgressLog`] from a [`ProgressLog`]. Thus, in case you need both\nsequential and concurrent logging you can pass a `\u0026mut impl ProgressLog` and\nthen obtain a concurrent logger from it. If the original logger is `None`, the\nconcurrent logger will be `None`, too, and so on.\n\nThere is an [`info`] method that can be used to log information to the logger at\nthe `info` level. The advantage of using [`info`] is that the logging will be\noptional depending on the type of the logger.\n\n## Acknowledgments\n\nThis software has been partially supported by project SERICS (PE00000014) under\nthe NRRP MUR program funded by the EU - NGEU. Views and opinions expressed are\nhowever those of the authors only and do not necessarily reflect those of the\nEuropean Union or the Italian MUR. Neither the European Union nor the Italian\nMUR can be held responsible for them.\n\n[`ProgressLog`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/trait.ProgressLog.html\u003e\n[`ProgressLogger`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/struct.ProgressLogger.html\u003e\n[`ConcurrentProgressLog`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/trait.ConcurrentProgressLog.html\u003e\n[`ConcurrentWrapper`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/struct.ConcurrentWrapper.html\u003e\n[`info`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/trait.ProgressLog.html#tymethod.info\u003e\n[`display_memory`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/trait.ProgressLog.html#tymethod.display_memory\u003e\n[`ProgressLog::concurrent`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/trait.ProgressLog.html#tymethod.concurrent\u003e\n[`it.unimi.dsi.util.ProgressLogger`]: \u003chttps://dsiutils.di.unimi.it/docs/it/unimi/dsi/logging/ProgressLogger.html\u003e\n[DSI Utilities]: \u003chttps://dsiutils.di.unimi.it/\u003e\n[`log`]: \u003chttps://docs.rs/log\u003e\n[`no_logging!`]: \u003chttps://docs.rs/dsi-progress-logger/latest/dsi_progress_logger/macro.no_logging.html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvigna%2Fdsi-progress-logger-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvigna%2Fdsi-progress-logger-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvigna%2Fdsi-progress-logger-rs/lists"}