Do not log CSS parse errors to stderr by default.

Fix #2083. Change the log level of CSS errors from error to info.
This commit is contained in:
Simon Sapin 2014-05-15 19:26:14 +01:00
parent c753f3ee05
commit aca8e1ea5f

View file

@ -26,10 +26,13 @@ impl<T, I: Iterator<Result<T, SyntaxError>>> Iterator<T> for ErrorLoggerIterator
// Using bool is a work-around for https://github.com/mozilla/rust/issues/13322 // Using bool is a work-around for https://github.com/mozilla/rust/issues/13322
local_data_key!(silence_errors: bool) local_data_key!(silence_errors: bool)
/// Defaults to a no-op.
/// Set a `RUST_LOG=style::errors` environment variable
/// to log CSS parse errors to stderr.
pub fn log_css_error(location: SourceLocation, message: &str) { pub fn log_css_error(location: SourceLocation, message: &str) {
// TODO eventually this will got into a "web console" or something. // TODO eventually this will got into a "web console" or something.
if silence_errors.get().is_none() { if silence_errors.get().is_none() {
error!("{:u}:{:u} {:s}", location.line, location.column, message) info!("{:u}:{:u} {:s}", location.line, location.column, message)
} }
} }