Skip to content

Logger calls use f-strings instead of lazy % formatting #6

Description

@KrishanYadav333

Problem

Several logger calls across the PyASL codebase use f-strings for message formatting:

logger.info(f"Pipeline type: {ptype}")

This is an anti-pattern because the f-string is eagerly evaluated even when the log level is disabled, wasting CPU cycles unnecessarily on string construction.

Expected Behaviour

Logger calls should use lazy %-style formatting, which only evaluates if the message will actually be emitted:

logger.info("Pipeline type: %s", ptype)

Affected Files

File Occurrences
pyasl/pipelines/run_pipeline.py 5
pyasl/modules/oxford_asl_split_m0.py 2
pyasl/modules/save_outputs.py 1

Total: 8 occurrences

References

I'll open a PR to fix all 8 occurrences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions