Skip to main content

A pre-commit script to make log lines lazzier

Project description

Lazy log

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: v0.1.0
  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.2.0.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

lazy_log_formatter-0.2.0-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

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