Set default rust log level to warn on debug builds

RESOLVED FIXED

Status

()

Core
Build Config
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

a year ago
We don't really have a great equivalent of NS_WARNING for rust code right now. warn!() is disabled by default, and error!() runs in release builds.

We should configure gecko somehow so that --enable-debug builds set the Rust's log level to 'warn'.
It looks like env_logger has support for parsing the log level from a string now:
https://docs.rs/env_logger/0.4.0/env_logger/struct.LogBuilder.html#method.parse

We could do something like:
``
let mut builder = LogBuilder::new();
match env::var("RUST_LOG") {
  Ok(v) => builder.parse(&v).init(),
  _ => builder.parse("warn").init(),
}
```

We'd have to call that during startup, obviously.
(Assignee)

Updated

a year ago
Assignee: nobody → bobbyholley
(Assignee)

Updated

a year ago
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.