/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{SyntaxError, SourceLocation}; pub struct ErrorLoggerIterator(I); impl>> Iterator for ErrorLoggerIterator { pub fn next(&mut self) -> Option { for result in **self { match result { Ok(v) => return Some(v), Err(error) => log_css_error(error.location, fmt!("%?", error.reason)) } } None } } pub fn log_css_error(location: SourceLocation, message: &str) { // TODO eventually this will got into a "web console" or something. info!("%u:%u %s", location.line, location.column, message) }