Skip to content

Commit

Permalink
Use lazy % formatting in logging calls
Browse files Browse the repository at this point in the history
It is preferred to use the lazier % style formatting instead of f-
strings when formatting logging messages.
  • Loading branch information
mcdonnnj committed Jan 16, 2022
1 parent a351baa commit 186992c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/apb_dashboard/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main() -> None:
sys.exit(-1)

# Read json data created by apb action
logging.info(f"Loading json data from: {read_filename}")
logging.info("Loading json data from: %s", read_filename)
with (Path(github_workspace_dir) / Path(read_filename)).open() as f:
data = json.load(f)

Expand All @@ -74,7 +74,7 @@ def main() -> None:

# Render the internal or external template
if template_filename:
logging.info(f"Loading template file: {template_filename}")
logging.info("Loading template file: %s", template_filename)
with (Path(github_workspace_dir) / Path(template_filename)).open() as f:
template_data: str = f.read()
logging.info("Rendering template from external file.")
Expand All @@ -84,6 +84,6 @@ def main() -> None:
rendered = pystache.render(TEMPLATE, data)

# Write rendered data out to file
logging.info(f"Writing rendered data to: {write_filename}")
logging.info("Writing rendered data to: %s", write_filename)
with (Path(github_workspace_dir) / Path(write_filename)).open("w") as f:
f.write(rendered)

0 comments on commit 186992c

Please sign in to comment.