mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Better debugging for stylesheets and URLs.
Bug: 1470145 Reviewed-by: xidorn MozReview-Commit-ID: FIcz2K1ZYX0
This commit is contained in:
parent
46e572a497
commit
f564b32b75
6 changed files with 63 additions and 28 deletions
|
@ -7,7 +7,6 @@
|
|||
#![deny(missing_docs)]
|
||||
|
||||
use cssparser::{BasicParseErrorKind, ParseErrorKind, SourceLocation, Token};
|
||||
use log;
|
||||
use std::fmt;
|
||||
use style_traits::ParseError;
|
||||
use stylesheets::UrlExtraData;
|
||||
|
@ -229,8 +228,10 @@ pub trait ParseErrorReporter {
|
|||
/// This logging is silent by default, and can be enabled with a `RUST_LOG=style=info`
|
||||
/// environment variable.
|
||||
/// (See [`env_logger`](https://rust-lang-nursery.github.io/log/env_logger/).)
|
||||
#[cfg(feature = "servo")]
|
||||
pub struct RustLogReporter;
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
impl ParseErrorReporter for RustLogReporter {
|
||||
fn report_error(
|
||||
&self,
|
||||
|
@ -238,6 +239,7 @@ impl ParseErrorReporter for RustLogReporter {
|
|||
location: SourceLocation,
|
||||
error: ContextualParseError,
|
||||
) {
|
||||
use log;
|
||||
if log_enabled!(log::Level::Info) {
|
||||
info!(
|
||||
"Url:\t{}\n{}:{} {}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue