qimpy.io.log_config

log_config(*, output_file=None, mpi_log=None, mpi_comm=None, append=True, verbose=False)

Configure logging globally for the qimpy library. It should typically only be necessary to call this once during start-up. Note that the default log configuration before calling this function is to print only warnings and errors will from all processes to stdout.

For further customization, directly modify the logging.Logger object log, as required.

Parameters:
  • output_file (str | None) – Output file to write from MPI rank 0. Default = None implies log to stdout.

  • mpi_log (str | None) – Higher-rank MPI processes will log to <mpi_log>.<process> if given. Default = None implies log only from head (rank=0) process.

  • mpi_comm (Comm | None) – MPI communicator whose rank determines logging behavior. Default = None implies use COMM_WORLD.

  • append (bool) – Whether log files should be appended or overwritten.

  • verbose (bool) – Whether to log debug information including module/line numbers of code.