We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 99ee890 + ced5863 commit 3a7b28cCopy full SHA for 3a7b28c
1 file changed
src/lib.rs
@@ -46,6 +46,32 @@
46
//! }
47
//! ```
48
//!
49
+//! The following example is how this would be performed with the new declarative inline module syntax
50
+//! introduced in PyO3 0.23 and above.
51
+//!
52
+//! ```rust
53
+//! # mod test_declarative_example {
54
+//! use pyo3::prelude::*;
55
+//! use log::info;
56
57
+//! #[pymodule]
58
+//! mod my_module{
59
+//! use super::*;
60
61
+//! #[pymodule_init]
62
+//! fn init(_m: &Bound<'_, PyModule>) -> PyResult<()> {
63
+//! pyo3_log::init();
64
+//! Ok(())
65
+//! }
66
67
+//! #[pyfunction]
68
+//! fn log_something() {
69
+//! info!("Something!");
70
71
72
+//! # }
73
+//! ```
74
75
//! # Performance, Filtering and Caching
76
77
//! Ideally, the logging system would always consult the Python loggers to know which messages
0 commit comments