diff src/logging.rs @ 103:dfcd96a74ac4 default tip

write a truly prodigious amount of documentation adds a bunch of links to the OpenPAM man pages and the XSSO spec as well as just a bunch of prose and stuff.
author Paul Fisher <paul@pfish.zone>
date Wed, 25 Jun 2025 00:59:24 -0400
parents b87100c5eed4
children
line wrap: on
line diff
--- a/src/logging.rs	Tue Jun 24 18:11:38 2025 -0400
+++ b/src/logging.rs	Wed Jun 25 00:59:24 2025 -0400
@@ -78,7 +78,10 @@
 /// ```no_run
 /// # fn _test(pam_handle: impl nonstick::PamShared) {
 /// # let load_error = "xxx";
-/// nonstick::error!(pam_handle, "error loading data from data source: {load_error}");
+/// nonstick::error!(
+///     pam_handle,
+///     "error loading data from data source: {load_error}"
+/// );
 /// // Will log a message like "error loading data from data source: timed out"
 /// // at ERROR level on syslog.
 /// # }
@@ -94,8 +97,12 @@
 ///
 /// ```no_run
 /// # fn _test(pam_handle: impl nonstick::PamShared) {
-/// # let latency_ms = "xxx";
-/// nonstick::warn!(pam_handle, "loading took too long: {latency_ms} ms");
+/// # let (start, finish) = (0, 0);
+/// nonstick::warn!(
+///     pam_handle,
+///     "loading took too long: {latency_ms} ms",
+///     latency_ms = start - finish
+/// );
 /// // Will log a message like "loading took too long: 495 ms"
 /// // at WARN level on syslog.
 /// # }