opencmp icon indicating copy to clipboard operation
opencmp copied to clipboard

Sequential runs from python cause logging output to output multiple copies

Open Alex-Vasile opened this issue 2 years ago • 0 comments

If a run script like the following is used:

from opencmp.run import run

if __name__ == "__main__":
    # Run Stokes
    run("config_Stokes")  # Works correctly

    # Run INS
    run("config_INS")  # Each logging states outputs 2 copies

The output from logging.info, logging.warning, etc. will be multipled in the INS run. I.e. each logged statement will be shown twice.

This has something to do with how the logging module works since using the following script will cause logging outputs to multiply:

from opencmp.run import run

if __name__ == "__main__":
    # Run Stokes
    run("config_Stokes")  # Works correctly
    run("config_Stokes")  # Each logging states outputs 2 copies
    run("config_Stokes")  # Each logging states outputs 3 copies
    run("config_Stokes")  # Each logging states outputs 4 copies

    # Run INS
    run("config_INS")  # Each logging states outputs 5 copies

This only affect the console output, and not the writing to file.

Alex-Vasile avatar Jun 20 '23 15:06 Alex-Vasile