Skip to content

Use placeholder-based approach for logger_error and logger_warning #3384

@stefan6419846

Description

@stefan6419846

The official Python docs recommend to use the placeholder-based approach for logging instead of f-strings: https://docs.python.org/3/howto/logging.html#logging-variable-data The background is that f-strings will always be evaluated - even if the user has configured the logger to not log this level for some reasons.

To fulfill this, we will have to rewrite logger_error and logger_warning to take a tuple/list of arbitrary values as the second parameter and adapt the actual log calls inside them accordingly. All usages of logger_* will have to be adapted as well.

As this only affects internal implementation details, there is no need to do a deprecation period.

Metadata

Metadata

Assignees

No one assigned

    Labels

    is-maintenanceAnything that is just internal: Simplifying code, syntax changes, updating docs, speed improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions