file-per-thread-logger

Crates.iofile-per-thread-logger
lib.rsfile-per-thread-logger
version0.2.0
sourcesrc
created_at2018-07-30 17:09:34.053923
updated_at2023-06-02 08:14:42.993422
descriptionA logging implementation that writes logs in one file per thread
homepage
repositoryhttps://github.com/bnjbvr/file-per-thread-logger
max_upload_size
id76679
size32,553
Benjamin Bouvier (bnjbvr)

documentation

https://docs.rs/file-per-thread-logger

README

File per thread logger

This is a thread-safe logger that will write logs to files, each thread owning its own file.

Usage

Put this in your Cargo.toml:

[dependencies]
file-per-thread-logger = "0.1.2"

Then add this to your code, once per thread:

file_per_thread_logger::initialize("file_prefix-");

Then each use of log's primitive will log into files named the following way:

  • the main thread get a file that's suffixed after the program's name.
  • unnamed threads get a file suffixed with ThreadIdN where N is the thread's id number.
  • named threads get a file suffixed with the thread's name.
Commit count: 58

cargo fmt