Getting the number of Krylov iterations per Newton step

Is there a way to obtain the number of Krylov iterations required by the linear solver in a Newton step, when using NewtonSolver?

I see that in the C++ code, NewtonSolver tracks the total Krylov iterations in each call to solve() in a member variable, which is almost what I am looking for; but this information is only emitted in the log – there is no binding to to Python to retrieve this value.

I would suggest implementing the Newton solver by hand to get such information. See:
https://jorgensd.github.io/dolfinx-tutorial/chapter4/newton-solver.html#newtons-method-with-dirichletbc