Skip to content

Commit

Permalink
Added START and END to log message in plugin manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwieters authored and pgierz committed Feb 3, 2025
1 parent 3fd4688 commit d4c1548
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/esm_plugin_manager/esm_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,31 @@ def check_plugin_availability(plugins):


def work_through_recipe(recipe, plugins, config):
"""
Works through the esm_runscripts recipes and plugin recipes.
Parameters
----------
recipe : dict # What is in these two dictionaries? Where do the entries are comming from?
plugins : dict
config : dict
Returns
-------
config : dict
"""
if config.get("general", {}).get("debug_recipe", False):
import pdb

pdb.set_trace()
recipes = recipe["recipe"]
recipe_name = recipe["job_type"]
# Loop over the recipe
for index, workitem in enumerate(recipes, start=1):
if config["general"].get("verbose", False):
# diagnostic message of which recipe step is being executed
message = (
f"::: Executing the step: {workitem} "
f"::: START Executing the step: {workitem} "
f"(step [{index}/{len(recipes)}] of the job: "
f'{recipe["job_type"]})'
)
Expand Down Expand Up @@ -187,6 +201,19 @@ def work_through_recipe(recipe, plugins, config):
config = timed_workitem_callable(config)
else:
config = getattr(thismodule, workitem)(config)
config = getattr(thismodule, workitem)(config)
if config["general"].get("verbose", False):
# diagnostic message of which recipe step is being executed
message = (
f"::: END Executing the step: {workitem} "
f"(step [{index}/{len(recipes)}] of the job: "
f'{recipe["job_type"]})'
)

logger.info()
logger.info("=" * len(message))
logger.info(message)
logger.info("=" * len(message))
return config


Expand Down

0 comments on commit d4c1548

Please sign in to comment.