Skip to content

Improve Logging - #670

Open
tabassom-entezami wants to merge 3 commits into
TreyWW:mainfrom
tabassom-entezami:main
Open

Improve Logging#670
tabassom-entezami wants to merge 3 commits into
TreyWW:mainfrom
tabassom-entezami:main

Conversation

@tabassom-entezami

Copy link
Copy Markdown
Contributor

Description

The primary reason to pass variables as arguments using %s rather than embedding them directly in an f-string is to utilize lazy evaluation. By passing the template and the variable separately, the logging module only spends computational resources constructing the final string if that specific log level is currently enabled. Furthermore, it allows log monitoring tools to accurately group similar events together.

Checklist

  • Ran the Black Formatter and
    djLint-er on any new code
  • Made any changes or additions to the documentation where required
  • Changes generate no new warnings/errors
  • New and existing unit tests pass locally with my
    changes

What type of PR is this?

  • ♻️ Code Refactor

Added/updated tests?

  • 🙅 no, because they aren't needed

Related PRs, Issues etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant