optional-log 0.1.2

A simple way to provide an optional `log` feature for you crates
Documentation
  • Coverage
  • 12.5%
    1 out of 8 items documented0 out of 0 items with examples
  • Size
  • Source code size: 16.92 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.19 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • NichtsHsu/optional-log
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • NichtsHsu

Optional Log

What

This crate provides an optional wrapper around the "log" crate, which allows you to provide an optional "log" feature for you crates easily.

How

In your "Cargo.toml":

[dependencies]
log = { version = "0.4", optional = true }
optional-log = "0.1"

[feature]
log = ["dep:log", "optional-log/log"]

Then use macros of "optional-log" crate instead of those of the "log" crate.

In this way, once the "log" feature of your crate is enabled by downstream, these macros will be expanded to the corresponding macros of the "log" crate, otherwise they do nothing.

The log_enabled! macro will always return false if the "log" feature is not enabled.