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

Re-export the log crate from tracing-log #602

Merged
merged 1 commit into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ pub use self::trace_logger::TraceLogger;
#[cfg_attr(docsrs, doc(cfg(feature = "env_logger")))]
pub mod env_logger;

pub use log;

/// Format a log record as a trace event in the current span.
pub fn format_trace(record: &log::Record<'_>) -> io::Result<()> {
let filter_meta = record.as_trace();
Expand Down
10 changes: 10 additions & 0 deletions tracing-log/tests/reexport_log_crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use tracing_log::{log::LevelFilter, LogTracer};

/// This test makes sure we can access `log::LevelFilter` through the `tracing_log` crate and don't
/// have to depend on `log` separately.
///
/// See https://github.com/tokio-rs/tracing/issues/552.
#[test]
fn can_initialize_log_tracer_with_level() {
LogTracer::init_with_filter(LevelFilter::Error).unwrap();
}