Skip to content

EnvFilter::from_default_env() acts differently to env_logger #512

Closed
@sazzer

Description

@sazzer

Bug Report

Version

tracing = "0.1.11"
tracing-log = "0.1.1"
tracing-subscriber = "0.1.6"

Platform

Darwin xxxxx.local 18.7.0 Darwin Kernel Version 18.7.0: Sat Oct 12 00:02:19 PDT 2019; root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64

Crates

tracing-subscriber

Description

I've just migrated from log and env_logger to use tracing instead, and I've found that the way RUST_LOG is parsed is not the same between the two.

Specifically, the following:

RUST_LOG=debug,tokio_postgres=info,hyper::server::response=info

Means:

  • With env_logger - treat all loggers as DEBUG except for tokio_postgres and hyper::server::response
  • With EnvFilter::from_default_env() - treat all loggers as DEBUG. This then overrides the explicit setting of INFO for the other two, so they are DEBUG as well.

Metadata

Metadata

Assignees

Labels

crate/subscriberRelated to the `tracing-subscriber` cratekind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions