multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

Remote logging does not format %s placeholders #149

Closed maarten-ic closed 1 year ago

maarten-ic commented 1 year ago

Reproduction:

  1. In docs/source/examples/python/reaction.py add a logging statement in the reuse loop with a %s placeholder, for example logging.warning("Reusing %s instance", "reaction")
  2. Run the examples (make test_examples)
  3. Check output of run_reaction_diffusion_python_<date>_<time>:
    • instances/micro/stderr.txt displays Reusing reaction instance, as expected
    • muscle3_manager.log displays Reusing %s instance

Expected behaviour:

The muscle manager logs should also show the formatted message.

To fix:

Format the message in MuscleManagerHandler before creating the LogMessage. See for example the python StreamHandler.emit implementation here.