Skip to main content

A pre-commit script to make log lines lazzier

Project description

Lazy log formatter

Pre-commit hook to automatically detect and convert f-strings in Python code used in log calls to lazy log calls, following W1203 Pylint rule:

https://pylint.readthedocs.io/en/stable/user_guide/messages/warning/logging-fstring-interpolation.html

Usage

To use with pre-commit, add the following to your .pre-commit-config.yaml:

- repo: https://github.com/dmar1n/lazy-log-formatter
  rev: 0.3.3
  hooks:
    - id: lazy-log-formatter
    args: ['--fix']

Options

  • --fix: Automatically fix f-strings used in log calls to lazy log calls.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazy_log_formatter-0.3.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

lazy_log_formatter-0.3.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file lazy_log_formatter-0.3.3.tar.gz.

File metadata

  • Download URL: lazy_log_formatter-0.3.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for lazy_log_formatter-0.3.3.tar.gz
Algorithm Hash digest
SHA256 c8ccccc5601e0b04d59e03fdb4ba1da6155c479019e2a670bacd27fffc0d7a95
MD5 ac56aa67933c6e9da9add3e6908bcfa1
BLAKE2b-256 18bb08953918619b7a0dbe9e9d7bdbacba6e7f685b4ec2ab4f9fe0074325a61e

See more details on using hashes here.

File details

Details for the file lazy_log_formatter-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for lazy_log_formatter-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 054771be87d112165d841e8ef5389959890828cbe367ed900ac68da81204eea3
MD5 b7a1fad06f391c721979d72f8cff60d7
BLAKE2b-256 83179aca5ef466bc0bdb455867ee6f999a18cacf7b2d8091b94ebc948dedaabc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page