[librsvg: 3/4] Note on the tracing crate for API observability




commit 056b4020e03726d3bc4b5f84b8b85e94a0669afc
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 22 15:26:55 2022 -0500

    Note on the tracing crate for API observability
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/751>

 devel-docs/api_observability.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/devel-docs/api_observability.rst b/devel-docs/api_observability.rst
index 5a19b424b..e4dcbd498 100644
--- a/devel-docs/api_observability.rst
+++ b/devel-docs/api_observability.rst
@@ -162,6 +162,28 @@ Log name/base_uri of rendered document.
 Can we know if it is a gresource? Or a byte buffer? Did it come from
 gdk-pixbuf?
 
+Implementation
+--------------
+
+There is currently the start of a `Session
+<https://gnome.pages.gitlab.gnome.org/librsvg/internals/librsvg/session/struct.Session.html>`_
+type woven throughout the source code, with the idea of it being the
+thing that records logging events, it may be better to plug into the ``tracing`` ecosystem:
+
+https://crates.io/crates/tracing
+
+Initial ideas:
+
+* See the "In libraries" section in ``tracing``'s README; it shows how
+  to create spans for API calls.
+
+* How would we capture from gnome-shell?  `tracing-journald
+  <https://tracing-rs.netlify.app/tracing_journald/index.html>`_?
+  Or would things be easier for casual users if we logged to a file?
+
+* Maybe later, have a ``tracing-sysprof`` crate to send the events to
+  `sysprof <https://gitlab.gnome.org/GNOME/sysprof/-/tree/master/src>`_?
+
 Log contents
 ------------
 


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