Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for tracing crate #127

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Nov 17, 2024

It is no longer necessary to have to depend on both log and tracing-log
to use clap-verbosity-flag with the tracing crate. This commit adds
support for the tracing crate directly.

  • Add tracing-core as a dependency
  • Add tracing as a feature
  • Add tracing module
  • Remove tracing-log as a dependency for the tracing example

@coveralls
Copy link

coveralls commented Nov 17, 2024

Pull Request Test Coverage Report for Build 11903211964

Details

  • 21 of 44 (47.73%) changed or added relevant lines in 2 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 48.889%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib.rs 5 12 41.67%
src/log.rs 16 32 50.0%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 5 48.28%
Totals Coverage Status
Change from base Build 11897580108: -0.02%
Covered Lines: 44
Relevant Lines: 90

💛 - Coveralls

src/tracing.rs Show resolved Hide resolved
- Add log feature flag (enabled by default)
- Move log specific code to `log` module
- Move top level re-exports of log types to `log` module

BREAKING CHANGE: The log crate is now an optional dependency, enabled by
default. The `log::Level` and `log::LevelFilter` types are now
re-exported from the `log` module rather than the crate root. If you
were using these types directly, you will need to update your imports.

```diff
-use clap_verbosity_flag::{Level, LevelFilter};
+use clap_verbosity_flag::log::{Level, LevelFilter};
```
It is no longer necessary to have to depend on both log and tracing-log
to use clap-verbosity-flag with the tracing crate. This commit adds
support for the tracing crate directly.

- Add `tracing-core` as a dependency
- Add `tracing` as a feature
- Add `tracing` module
- Remove `tracing-log` as a dependency for the `tracing` example
@joshka joshka force-pushed the jm/tracing-support branch from d6289a5 to 53b0316 Compare November 18, 2024 23:43
@epage epage merged commit 9118db6 into clap-rs:master Nov 20, 2024
17 checks passed
@joshka joshka deleted the jm/tracing-support branch November 21, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants