Skip to content

Sequential runs from python cause logging output to output multiple copies #48

@Alex-Vasile

Description

@Alex-Vasile

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions