logging-too-many-args / E1205ΒΆ

Message emitted:

Too many arguments for logging format string

Description:

Used when a logging format string is given too many arguments.

Problematic code:

import logging

try:
    function()
except Exception as e:
    logging.error("Error occurred: %s", type(e), e)  # [logging-too-many-args]
    raise

Correct code:

import logging

try:
    function()
except Exception as e:
    logging.error("%s error occurred: %s", type(e), e)
    raise

Created by the logging checker.