log-rs 0.1.1

A small logging library.
Documentation
  • Coverage
  • 33.33%
    2 out of 6 items documented0 out of 0 items with examples
  • Size
  • Source code size: 13.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 409.17 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • guilhemSmith/log-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • guilhemSmith

log-rs

A small logging library.
Can log on 4 level: INFO, DEBUG, WARNING, and ERROR.
Each level can be configured to write to a specific output.

Example

let mut log = Logger::new().unwrap();
log.config_format("[%l|%t]: %m");

log.config_info(OutputKind::STDOUT);
log.config_debug(OutputKind::STDERR);
log.config_warning(OutputKind::FILE("errlog.txt"));
log.config_error(OutputKind::FILE("errlog.txt"));

log.info("informations.");
log.warning("my warning.");
log.debug("more informations.");
log.error("an error.");

Display of sdtout:

[INFO|2020-04-07T15:42:31+0000]: informations.

Display of sdterr:

[DEBUG|2020-04-07T15:42:31+0000]: more informations.

Content of errlog.txt:

[WARNING|2020-04-07T15:42:31+0000]: my warning.
[ERROR|2020-04-07T15:42:31+0000]: an error.