[librsvg: 44/45] Rename rsvg_log_session back to rsvg_log




commit 8cf6b3a66626be9aa50292ad1a2e824bc4dece0d
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Aug 23 20:41:21 2022 -0500

    Rename rsvg_log_session back to rsvg_log
    
    And there was much rejoicing.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/731>

 src/api.rs          |  6 +-----
 src/c_api/handle.rs | 16 ++++++++--------
 src/css.rs          |  8 ++++----
 src/drawing_ctx.rs  | 12 ++++++------
 src/element.rs      |  6 +++---
 src/filter.rs       |  6 +++---
 src/filters/mod.rs  |  8 ++++----
 src/gradient.rs     |  2 +-
 src/handle.rs       |  2 +-
 src/image.rs        |  2 +-
 src/layout.rs       |  4 ++--
 src/log.rs          |  2 +-
 src/marker.rs       |  2 +-
 src/paint_server.rs |  4 ++--
 src/pattern.rs      |  2 +-
 src/properties.rs   | 12 ++++++------
 src/shapes.rs       |  6 +++---
 src/text.rs         |  2 +-
 src/xml/mod.rs      |  8 ++++----
 19 files changed, 53 insertions(+), 57 deletions(-)
---
diff --git a/src/api.rs b/src/api.rs
index 44057a207..38bb0bc4e 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -339,11 +339,7 @@ impl UserLanguage {
             Language::FromEnvironment => UserLanguage::LanguageTags(
                 LanguageTags::from_locale(&locale_from_environment())
                     .map_err(|s| {
-                        rsvg_log_session!(
-                            session,
-                            "could not convert locale to language tags: {}",
-                            s
-                        );
+                        rsvg_log!(session, "could not convert locale to language tags: {}", s);
                     })
                     .unwrap_or_else(|_| LanguageTags::empty()),
             ),
diff --git a/src/c_api/handle.rs b/src/c_api/handle.rs
index d68e60cdc..bd1663ac4 100644
--- a/src/c_api/handle.rs
+++ b/src/c_api/handle.rs
@@ -42,7 +42,7 @@ use crate::api::{self, CairoRenderer, IntrinsicDimensions, Loader, LoadingError,
 
 use crate::{
     length::RsvgLength,
-    rsvg_log_session,
+    rsvg_log,
     session::Session,
     surface_utils::shared_surface::{SharedImageSurface, SurfaceType},
 };
@@ -576,13 +576,13 @@ impl CHandle {
 
         match Url::parse(url) {
             Ok(u) => {
-                rsvg_log_session!(session, "setting base_uri to \"{}\"", u.as_str());
+                rsvg_log!(session, "setting base_uri to \"{}\"", u.as_str());
                 let mut inner = imp.inner.borrow_mut();
                 inner.base_url.set(u);
             }
 
             Err(e) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "not setting base_uri to \"{}\" since it is invalid: {}",
                     url,
@@ -1343,7 +1343,7 @@ pub unsafe extern "C" fn rsvg_handle_get_pixbuf(
         Ok(pixbuf) => pixbuf.to_glib_full(),
         Err(e) => {
             let session = &rhandle.imp().session;
-            rsvg_log_session!(session, "could not render: {}", e);
+            rsvg_log!(session, "could not render: {}", e);
             ptr::null_mut()
         }
     }
@@ -1367,7 +1367,7 @@ pub unsafe extern "C" fn rsvg_handle_get_pixbuf_sub(
         Ok(pixbuf) => pixbuf.to_glib_full(),
         Err(e) => {
             let session = &rhandle.imp().session;
-            rsvg_log_session!(session, "could not render: {}", e);
+            rsvg_log!(session, "could not render: {}", e);
             ptr::null_mut()
         }
     }
@@ -1406,7 +1406,7 @@ pub unsafe extern "C" fn rsvg_handle_get_dimensions_sub(
 
         Err(e) => {
             let session = &rhandle.imp().session;
-            rsvg_log_session!(session, "could not get dimensions: {}", e);
+            rsvg_log!(session, "could not get dimensions: {}", e);
             *dimension_data = RsvgDimensionData::empty();
             false.into_glib()
         }
@@ -1443,7 +1443,7 @@ pub unsafe extern "C" fn rsvg_handle_get_position_sub(
             p.y = 0;
 
             let session = &rhandle.imp().session;
-            rsvg_log_session!(session, "could not get position: {}", e);
+            rsvg_log!(session, "could not get position: {}", e);
             false.into_glib()
         }
     }
@@ -2040,7 +2040,7 @@ pub(crate) fn set_gerror(
         //
         // See https://gitlab.gnome.org/GNOME/gtk/issues/2294 for an example of code that
         // passed a NULL GError and so we had no easy way to see what was wrong.
-        rsvg_log_session!(session, "{}", msg);
+        rsvg_log!(session, "{}", msg);
 
         glib::ffi::g_set_error_literal(
             err,
diff --git a/src/css.rs b/src/css.rs
index 5d5d0abd5..d7bd4817d 100644
--- a/src/css.rs
+++ b/src/css.rs
@@ -285,7 +285,7 @@ impl<'i> QualifiedRuleParser<'i> for RuleParser {
             .filter_map(|r| match r {
                 Ok(decl) => Some(decl),
                 Err(e) => {
-                    rsvg_log_session!(self.session, "Invalid declaration; ignoring: {:?}", e);
+                    rsvg_log!(self.session, "Invalid declaration; ignoring: {:?}", e);
                     None
                 }
             })
@@ -844,7 +844,7 @@ impl Stylesheet {
             .filter_map(|r| match r {
                 Ok(rule) => Some(rule),
                 Err(e) => {
-                    rsvg_log_session!(session, "Invalid rule; ignoring: {:?}", e);
+                    rsvg_log!(session, "Invalid rule; ignoring: {:?}", e);
                     None
                 }
             })
@@ -881,13 +881,13 @@ impl Stylesheet {
                 if is_text_css(&mime_type) {
                     Ok(bytes)
                 } else {
-                    rsvg_log_session!(session, "\"{}\" is not of type text/css; ignoring", aurl);
+                    rsvg_log!(session, "\"{}\" is not of type text/css; ignoring", aurl);
                     Err(LoadingError::BadCss)
                 }
             })
             .and_then(|bytes| {
                 String::from_utf8(bytes).map_err(|_| {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "\"{}\" does not contain valid UTF-8 CSS data; ignoring",
                         aurl
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 0342cfb51..6347304f7 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -500,7 +500,7 @@ impl DrawingCtx {
                         "viewport_to_viewbox_transform only returns errors when vbox != None"
                     ),
                     Some(v) => {
-                        rsvg_log_session!(
+                        rsvg_log!(
                             self.session,
                             "ignoring viewBox ({}, {}, {}, {}) since it is not usable",
                             v.x0,
@@ -588,7 +588,7 @@ impl DrawingCtx {
             Ok(n) => n,
 
             Err(AcquireError::CircularReference(_)) => {
-                rsvg_log_session!(self.session, "circular reference in element {}", mask_node);
+                rsvg_log!(self.session, "circular reference in element {}", mask_node);
                 return Ok(None);
             }
 
@@ -1056,7 +1056,7 @@ impl DrawingCtx {
             Ok(n) => n,
 
             Err(AcquireError::CircularReference(ref node)) => {
-                rsvg_log_session!(self.session, "circular reference in element {}", node);
+                rsvg_log!(self.session, "circular reference in element {}", node);
                 return Ok(false);
             }
 
@@ -1632,7 +1632,7 @@ impl DrawingCtx {
             Ok(n) => n,
 
             Err(AcquireError::CircularReference(_)) => {
-                rsvg_log_session!(self.session, "circular reference in element {}", node);
+                rsvg_log!(self.session, "circular reference in element {}", node);
                 return Ok(self.empty_bbox());
             }
 
@@ -1643,7 +1643,7 @@ impl DrawingCtx {
             Ok(acquired) => acquired,
 
             Err(AcquireError::CircularReference(node)) => {
-                rsvg_log_session!(self.session, "circular reference in element {}", node);
+                rsvg_log!(self.session, "circular reference in element {}", node);
                 return Ok(self.empty_bbox());
             }
 
@@ -1656,7 +1656,7 @@ impl DrawingCtx {
             Err(AcquireError::InvalidLinkType(_)) => unreachable!(),
 
             Err(AcquireError::LinkNotFound(node_id)) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     self.session,
                     "element {} references nonexistent \"{}\"",
                     node,
diff --git a/src/element.rs b/src/element.rs
index 96cc2302f..3d8fb60ba 100644
--- a/src/element.rs
+++ b/src/element.rs
@@ -252,7 +252,7 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
     }
 
     fn set_error(&mut self, error: ElementError, session: &Session) {
-        rsvg_log_session!(session, "setting node {} in error: {}", self, error);
+        rsvg_log!(session, "setting node {} in error: {}", self, error);
         self.is_in_error = true;
     }
 
@@ -279,7 +279,7 @@ impl<T: SetAttributes + Draw> Draw for ElementInner<T> {
                 Ok(draw_ctx.empty_bbox())
             }
         } else {
-            rsvg_log_session!(
+            rsvg_log!(
                 draw_ctx.session(),
                 "(not rendering element {} because it is in error)",
                 self
@@ -602,7 +602,7 @@ macro_rules! e {
             let is_in_error = if let Err(e) = element_impl.set_attributes(&attributes, session) {
                 // FIXME: this does not provide a clue of what was the problematic attribute, or the
                 // problematic element.  We need tracking of the current parsing position to do that.
-                rsvg_log_session!(session, "setting element in error: {}", e);
+                rsvg_log!(session, "setting element in error: {}", e);
                 true
             } else {
                 false
diff --git a/src/filter.rs b/src/filter.rs
index ac81d66e7..0e0180a37 100644
--- a/src/filter.rs
+++ b/src/filter.rs
@@ -131,7 +131,7 @@ fn filter_spec_from_filter_node(
     acquired_nodes
         .acquire(node_id)
         .map_err(|e| {
-            rsvg_log_session!(
+            rsvg_log!(
                 session,
                 "element {} will not be filtered with \"{}\": {}",
                 node_being_filtered_name,
@@ -147,7 +147,7 @@ fn filter_spec_from_filter_node(
             match *element {
                 Element::Filter(_) => {
                     if element.is_in_error() {
-                        rsvg_log_session!(
+                        rsvg_log!(
                             session,
                             "element {} will not be filtered since its filter \"{}\" is in error",
                             node_being_filtered_name,
@@ -160,7 +160,7 @@ fn filter_spec_from_filter_node(
                 }
 
                 _ => {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "element {} will not be filtered since \"{}\" is not a filter",
                         node_being_filtered_name,
diff --git a/src/filters/mod.rs b/src/filters/mod.rs
index 2f9f13aec..3165bdf80 100644
--- a/src/filters/mod.rs
+++ b/src/filters/mod.rs
@@ -272,7 +272,7 @@ pub fn extract_filter_from_filter_node(
             let in_error = c.borrow_element().is_in_error();
 
             if in_error {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "(ignoring filter primitive {} because it is in error)",
                     c
@@ -298,7 +298,7 @@ pub fn extract_filter_from_filter_node(
             effect
                 .resolve(acquired_nodes, &primitive_node)
                 .map_err(|e| {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "(filter primitive {} returned an error: {})",
                         primitive_name,
@@ -344,7 +344,7 @@ pub fn render(
             match render_primitive(user_space_primitive, &filter_ctx, acquired_nodes, draw_ctx) {
                 Ok(output) => {
                     let elapsed = start.elapsed();
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "(rendered filter primitive {} in\n    {} seconds)",
                         user_space_primitive.params.name(),
@@ -358,7 +358,7 @@ pub fn render(
                 }
 
                 Err(err) => {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "(filter primitive {} returned an error: {})",
                         user_space_primitive.params.name(),
diff --git a/src/gradient.rs b/src/gradient.rs
index d201a74fc..d44e4f2cb 100644
--- a/src/gradient.rs
+++ b/src/gradient.rs
@@ -421,7 +421,7 @@ impl UnresolvedGradient {
 
             if let Element::Stop(ref stop) = *elt {
                 if elt.is_in_error() {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "(not using gradient stop {} because it is in error)",
                         child
diff --git a/src/handle.rs b/src/handle.rs
index e18b2a17c..845da304c 100644
--- a/src/handle.rs
+++ b/src/handle.rs
@@ -214,7 +214,7 @@ impl Handle {
                 .lookup_internal_node(&id)
                 .ok_or(DefsLookupErrorKind::NotFound),
             NodeId::External(_, _) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     self.session,
                     "the public API is not allowed to look up external references: {}",
                     node_id
diff --git a/src/image.rs b/src/image.rs
index 64e948b3a..530bf09e5 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -59,7 +59,7 @@ impl Draw for Image {
             Some(ref url) => match acquired_nodes.lookup_image(url) {
                 Ok(surf) => surf,
                 Err(e) => {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         draw_ctx.session(),
                         "could not load image \"{}\": {}",
                         url,
diff --git a/src/layout.rs b/src/layout.rs
index c67164a45..4be72eb82 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -191,7 +191,7 @@ impl StackingContext {
                     Element::Mask(_) => Some(node.clone()),
 
                     _ => {
-                        rsvg_log_session!(
+                        rsvg_log!(
                             session,
                             "element {} references \"{}\" which is not a mask",
                             element,
@@ -202,7 +202,7 @@ impl StackingContext {
                     }
                 }
             } else {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "element {} references nonexistent mask \"{}\"",
                     element,
diff --git a/src/log.rs b/src/log.rs
index 952d8e6f2..36a363e20 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -1,7 +1,7 @@
 //! Utilities for logging messages from the library.
 
 #[macro_export]
-macro_rules! rsvg_log_session {
+macro_rules! rsvg_log {
     (
         $session:expr,
         $($arg:tt)+
diff --git a/src/marker.rs b/src/marker.rs
index e5c584f05..e416122ad 100644
--- a/src/marker.rs
+++ b/src/marker.rs
@@ -598,7 +598,7 @@ fn emit_marker_by_node(
         }
 
         Err(e) => {
-            rsvg_log_session!(draw_ctx.session(), "could not acquire marker: {}", e);
+            rsvg_log!(draw_ctx.session(), "could not acquire marker: {}", e);
             Ok(draw_ctx.empty_bbox())
         }
     }
diff --git a/src/paint_server.rs b/src/paint_server.rs
index ac758c790..57d4af468 100644
--- a/src/paint_server.rs
+++ b/src/paint_server.rs
@@ -181,7 +181,7 @@ impl PaintServer {
                     // later in the drawing code, so it should be fine to translate this
                     // condition to that for an invalid paint server.
                     Some(color) => {
-                        rsvg_log_session!(
+                        rsvg_log!(
                             session,
                             "could not resolve paint server \"{}\", using alternate color",
                             iri
@@ -191,7 +191,7 @@ impl PaintServer {
                     }
 
                     None => {
-                        rsvg_log_session!(
+                        rsvg_log!(
                             session,
                             "could not resolve paint server \"{}\", no alternate color specified",
                             iri
diff --git a/src/pattern.rs b/src/pattern.rs
index 28fba156f..6b1d394c5 100644
--- a/src/pattern.rs
+++ b/src/pattern.rs
@@ -473,7 +473,7 @@ impl Pattern {
                     }
 
                     Err(e) => {
-                        rsvg_log_session!(session, "Stopping pattern resolution: {}", e);
+                        rsvg_log!(session, "Stopping pattern resolution: {}", e);
                         pattern = pattern.resolve_from_defaults();
                         break;
                     }
diff --git a/src/properties.rs b/src/properties.rs
index 2b077d4cd..7c6c95a43 100644
--- a/src/properties.rs
+++ b/src/properties.rs
@@ -815,7 +815,7 @@ impl SpecifiedValues {
                 if parser.expect_exhausted().is_ok() {
                     self.set_parsed_property(&prop);
                 } else {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "(ignoring invalid presentation attribute {:?}\n    value=\"{}\")\n",
                         attr.expanded(),
@@ -840,7 +840,7 @@ impl SpecifiedValues {
                 let mut tok = String::new();
 
                 t.to_css(&mut tok).unwrap(); // FIXME: what do we do with a fmt::Error?
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "(ignoring invalid presentation attribute {:?}\n    value=\"{}\"\n    \
                      unexpected token '{}')",
@@ -854,7 +854,7 @@ impl SpecifiedValues {
                 kind: ParseErrorKind::Basic(BasicParseErrorKind::EndOfInput),
                 ..
             }) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "(ignoring invalid presentation attribute {:?}\n    value=\"{}\"\n    \
                      unexpected end of input)",
@@ -867,7 +867,7 @@ impl SpecifiedValues {
                 kind: ParseErrorKind::Basic(_),
                 ..
             }) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "(ignoring invalid presentation attribute {:?}\n    value=\"{}\"\n    \
                      unexpected error)",
@@ -880,7 +880,7 @@ impl SpecifiedValues {
                 kind: ParseErrorKind::Custom(ref v),
                 ..
             }) => {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "(ignoring invalid presentation attribute {:?}\n    value=\"{}\"\n    {})",
                     attr.expanded(),
@@ -967,7 +967,7 @@ impl SpecifiedValues {
             .filter_map(|r| match r {
                 Ok(decl) => Some(decl),
                 Err(e) => {
-                    rsvg_log_session!(session, "Invalid declaration; ignoring: {:?}", e);
+                    rsvg_log!(session, "Invalid declaration; ignoring: {:?}", e);
                     None
                 }
             })
diff --git a/src/shapes.rs b/src/shapes.rs
index 8af6a362e..d8565ee0f 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -168,7 +168,7 @@ fn acquire_marker(
         acquired_nodes
             .acquire(id)
             .map_err(|e| {
-                rsvg_log_session!(session, "cannot render marker: {}", e);
+                rsvg_log!(session, "cannot render marker: {}", e);
             })
             .ok()
             .and_then(|acquired| {
@@ -177,7 +177,7 @@ fn acquire_marker(
                 if is_element_of_type!(node, Marker) {
                     Some(node.clone())
                 } else {
-                    rsvg_log_session!(session, "{} is not a marker element", id);
+                    rsvg_log!(session, "{} is not a marker element", id);
                     None
                 }
             })
@@ -256,7 +256,7 @@ impl SetAttributes for Path {
                     // FIXME: we don't propagate errors upstream, but creating a partial
                     // path is OK per the spec
 
-                    rsvg_log_session!(session, "could not parse path: {}", e);
+                    rsvg_log!(session, "could not parse path: {}", e);
                 }
                 self.path = Rc::new(builder.into_path());
             }
diff --git a/src/text.rs b/src/text.rs
index 15b389a55..478672878 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -896,7 +896,7 @@ impl TRef {
             let c = acquired.get();
             extract_chars_children_to_chunks_recursively(chunks, c, Rc::new(values.clone()), depth);
         } else {
-            rsvg_log_session!(
+            rsvg_log!(
                 layout_context.session,
                 "element {} references a nonexistent text source \"{}\"",
                 node,
diff --git a/src/xml/mod.rs b/src/xml/mod.rs
index 7fb4e147e..b06e3fb34 100644
--- a/src/xml/mod.rs
+++ b/src/xml/mod.rs
@@ -280,14 +280,14 @@ impl XmlState {
                     .append_stylesheet_from_xml_processing_instruction(alternate, type_, &href)
                     .is_err()
                 {
-                    rsvg_log_session!(
+                    rsvg_log!(
                         session,
                         "invalid xml-stylesheet {} in XML processing instruction",
                         href
                     );
                 }
             } else {
-                rsvg_log_session!(
+                rsvg_log!(
                     session,
                     "xml-stylesheet processing instruction does not have href; ignoring"
                 );
@@ -502,7 +502,7 @@ impl XmlState {
                 .map_err(|e| {
                     // FIXME: should AlloweUrlError::UrlParseError be a fatal error,
                     // not a resource error?
-                    rsvg_log_session!(session, "could not acquire \"{}\": {}", href, e);
+                    rsvg_log!(session, "could not acquire \"{}\": {}", href, e);
                     AcquireError::ResourceError
                 })?;
 
@@ -542,7 +542,7 @@ impl XmlState {
             .clone();
 
         let binary = io::acquire_data(aurl, None).map_err(|e| {
-            rsvg_log_session!(session, "could not acquire \"{}\": {}", aurl, e);
+            rsvg_log!(session, "could not acquire \"{}\": {}", aurl, e);
             AcquireError::ResourceError
         })?;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]