log4r 0.1.1

Stupidly simple logging utils
Documentation
  • Coverage
  • 42.86%
    6 out of 14 items documented6 out of 7 items with examples
  • Size
  • Source code size: 5.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • WouterPennings/log4r
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • WouterPennings

log4r

A stupidly simple logging package for Rust.

The main advantage of log4r over log is the use of functions instead of macros. This way you can disallow them in clippy.toml, making it more suitable for debugging.

How to use

  1. First add the crate to Cargo.toml by adding log4r = 0.1.0 under your dependencies.
  2. Add use log4r::*; to the top of the file.
  3. You can now do something like this: info(some_info.to_string())

If only want to use these functions during development, add the following to your clippy.toml in the root of you project:

disallowed-methods = [

    { path = "log4r::success", reason = "Logs are not allowed in builds" },

    { path = "log4r::warning", reason = "Logs are not allowed in builds" },

    { path = "log4r::info", reason = "Logs are not allowed in builds" },

    { path = "log4r::error", reason = "Logs are not allowed in builds" },

    { path = "log4r::critical", reason = "Logs are not allowed in builds" },

    { path = "log4r::log", reason = "Logs are not allowed in builds" },

]

When you run Clippy, it will give errors/warnings over the use of these functions.