Skip to content

Commit

Permalink
Merge pull request #29 from vorner/args-tuple
Browse files Browse the repository at this point in the history
LogRecord args is tuple
  • Loading branch information
vorner authored Jul 14, 2023
2 parents a54237d + 69c770a commit 0fa5587
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* LogRecord takes tuple as `args`, provide an empty one and not a `None` (#28).

# 0.8.2

* Allow pyo3 0.19.
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
//! ```rust
//! use log::info;
//! use pyo3::prelude::*;
//! use pyo3::wrap_pyfunction;
//!
//! #[pyfunction]
//! fn log_something() {
Expand Down Expand Up @@ -163,6 +162,7 @@ use std::sync::Arc;
use arc_swap::ArcSwap;
use log::{Level, LevelFilter, Log, Metadata, Record, SetLoggerError};
use pyo3::prelude::*;
use pyo3::types::PyTuple;

/// A handle into a [`Logger`], able to reset its caches.
///
Expand Down Expand Up @@ -421,8 +421,8 @@ impl Logger {
record.file(),
record.line().unwrap_or_default(),
msg,
&none, // args
&none, // exc_info
PyTuple::empty(py), // args
&none, // exc_info
),
)?;
logger.call_method1("handle", (record,))?;
Expand Down

0 comments on commit 0fa5587

Please sign in to comment.