o
    h                     @  sz   d Z ddlmZ ddlZddlZeeZee	  dZ
edd e
dD ZejejdZd	ZdefdddZdS )zTop-level module for Flake8.

This module

- initializes logging for the command-line tool
- tracks the version of the package
- provides a way to configure logging for the command-line tool

.. autofunction:: flake8.configure_logging

    )annotationsNz6.1.0c                 c  s     | ]}|  rt|V  qd S )N)isdigitint).0i r   E/var/www/html/ai/venv/lib/python3.10/site-packages/flake8/__init__.py	<genexpr>   s    r	   .)      zO%(name)-25s %(processName)-11s %(relativeCreated)6d %(levelname)-8s %(message)s	verbosityr   filename
str | None	logformatstrreturnNonec                 C  s   | dkrdS t | tt} t|  }|r|dv r"tt|pd}tj}n|}tj}||}|t	| t
| t
| t
d|t dS )aI  Configure logging for flake8.

    :param verbosity:
        How verbose to be in logging information.
    :param filename:
        Name of the file to append log information to.
        If ``None`` this will log to ``sys.stderr``.
        If the name is "stdout" or "stderr" this will log to the appropriate
        stream.
    r   N)stderrstdoutr   z/Added a %s logging handler to logger root at %s)minmax_VERBOSITY_TO_LOG_LEVELgetattrsysloggingStreamHandlerFileHandlersetFormatter	FormatterLOG
addHandlersetLeveldebug__name__)r   r   r   	log_levelfileobjhandler_clshandlerr   r   r   configure_logging$   s    

r)   )r   r   r   r   r   r   r   r   )__doc__
__future__r   r   r   	getLoggerr$   r    r!   NullHandler__version__tuplesplit__version_info__INFODEBUGr   
LOG_FORMATr)   r   r   r   r   <module>   s     
