If you want to log all PETSc ASCII output you can use 

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscVFPrintf.html
  

Just don't use the FILE *fd initial argument, instead pass the output into a 
Python function that calls the logger as desired.

   Barry



> On May 29, 2017, at 11:17 AM, David Nolte <[email protected]> wrote:
> 
> Dear all,
> 
> is it possible to use python's logging module
> (https://docs.python.org/2/howto/logging.html) to handle PETSc output in
> python, such as the residuals during a KSP/SNES solve?
> I log my solver's activity to a file using the logging module, it would
> be great to include the PETSc output aswell.
> 
> Regards,
> David
> 

Reply via email to