11 releases (4 stable)

1.0.3 Sep 13, 2021
1.0.2 Nov 24, 2020
1.0.1 Aug 24, 2020
0.3.0 Jun 24, 2018
0.1.2 Mar 29, 2018

#512 in Debugging

Download history 1555/week @ 2024-06-12 1433/week @ 2024-06-19 1636/week @ 2024-06-26 1592/week @ 2024-07-03 1312/week @ 2024-07-10 1089/week @ 2024-07-17 1411/week @ 2024-07-24 1445/week @ 2024-07-31 1803/week @ 2024-08-07 1455/week @ 2024-08-14 1334/week @ 2024-08-21 1287/week @ 2024-08-28 1342/week @ 2024-09-04 1348/week @ 2024-09-11 1529/week @ 2024-09-18 1408/week @ 2024-09-25

5,858 downloads per month
Used in 4 crates (3 directly)

Apache-2.0/MIT

18KB
156 lines

Reopen

Actions Status codecov docs

A tiny Read/Write wrapper that can reopen the underlying IO object.

The main motivation is integration of logging with logrotate. Usually, when logrotate wants to rotate log files, it moves the current log file to a new place and creates a new empty file. However, for the new messages to appear in the new file, a running program needs to close and reopen the file. This is most often signalled by SIGHUP.

This allows reopening the IO object used inside the logging drain at runtime.

An example is in the documentation.

Future plans

The API feels feature complete to me, therefore there probably won't be much happening here. But I'm still open to ideas what would be good to have or PRs implementing it.

Rustc version policy

The project will build on any rustc 1.31.0 or newer. The only exception is feature flags added in the future, where enabling them might require newer compiler.

The tests or examples don't have any particular version guarantee (future versions of the project may only build on 1.31.0, but tests might require never compiler).

Change to this policy would be considered an API breaking change and would require bumping the version to 2.0.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~48KB