Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 547 Bytes

logging-too-few-args.md

File metadata and controls

24 lines (14 loc) · 547 Bytes

Pattern: Too few logging arguments

Issue: -

Description

Calls to logging that do not match formats against args may lead to confusion as code will not work as expected. Extra arguments will not be shown and missing arguments will raise IndexError. Update code so that formats and args are in sync.

Example of incorrect code:

logging.warn('%s, %s', 1)

Example of correct code:

logging.warn('%s, %s', 1, 2)

Further Reading