Mercurial > crates > nonstick
comparison 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 |
comparison
equal
deleted
inserted
replaced
102:94eb11cb1798 | 103:dfcd96a74ac4 |
---|---|
76 /// # Example | 76 /// # Example |
77 /// | 77 /// |
78 /// ```no_run | 78 /// ```no_run |
79 /// # fn _test(pam_handle: impl nonstick::PamShared) { | 79 /// # fn _test(pam_handle: impl nonstick::PamShared) { |
80 /// # let load_error = "xxx"; | 80 /// # let load_error = "xxx"; |
81 /// nonstick::error!(pam_handle, "error loading data from data source: {load_error}"); | 81 /// nonstick::error!( |
82 /// pam_handle, | |
83 /// "error loading data from data source: {load_error}" | |
84 /// ); | |
82 /// // Will log a message like "error loading data from data source: timed out" | 85 /// // Will log a message like "error loading data from data source: timed out" |
83 /// // at ERROR level on syslog. | 86 /// // at ERROR level on syslog. |
84 /// # } | 87 /// # } |
85 /// ``` | 88 /// ``` |
86 #[macro_export] | 89 #[macro_export] |
92 /// | 95 /// |
93 /// # Example | 96 /// # Example |
94 /// | 97 /// |
95 /// ```no_run | 98 /// ```no_run |
96 /// # fn _test(pam_handle: impl nonstick::PamShared) { | 99 /// # fn _test(pam_handle: impl nonstick::PamShared) { |
97 /// # let latency_ms = "xxx"; | 100 /// # let (start, finish) = (0, 0); |
98 /// nonstick::warn!(pam_handle, "loading took too long: {latency_ms} ms"); | 101 /// nonstick::warn!( |
102 /// pam_handle, | |
103 /// "loading took too long: {latency_ms} ms", | |
104 /// latency_ms = start - finish | |
105 /// ); | |
99 /// // Will log a message like "loading took too long: 495 ms" | 106 /// // Will log a message like "loading took too long: 495 ms" |
100 /// // at WARN level on syslog. | 107 /// // at WARN level on syslog. |
101 /// # } | 108 /// # } |
102 /// ``` | 109 /// ``` |
103 #[macro_export] | 110 #[macro_export] |