
    gx                     V   d Z ddlZddlZddlmZmZmZmZmZmZm	Z	m
Z
 ddlmZ ej        ej        ej
        ej        ej        dZej
        ZdefdZdej        fdZd	 Zdd
ZddZddee         dej        fdZdefdZdeddfdZd Zd Zd Zd ZddZddZ e             dS )zLogging utilities.    N)CRITICALDEBUGERRORFATALINFONOTSETWARNWARNING)Optional)debuginfowarningerrorcriticalreturnc                  B    t                               d          d         S )N.r   )__name__split     Y/var/www/html/ai-engine/env/lib/python3.11/site-packages/huggingface_hub/utils/logging.py_get_library_namer   +   s    >>#q!!r   c                  B    t          j        t                                S N)logging	getLoggerr   r   r   r   _get_library_root_loggerr   /   s    .00111r   c            	         t          j        dd          } | rl| t          v rt          |          S t          j                                        d|  dd                    t                                                                t          S )z
    If `HF_HUB_VERBOSITY` env var is set to one of the valid choices return that as the new default level. If it is not
    - fall back to `_default_log_level`
    HF_HUB_VERBOSITYNz Unknown option HF_HUB_VERBOSITY=z, has to be one of: z, )	osgetenv
log_levelsr   r   r   joinkeys_default_log_level)env_level_strs    r   _get_default_logging_levelr(   3   s    
 I0$77M J&&m,,''v=vvW[W`W`akapapararWsWsvv   r   c                      t                      } |                     t          j                               |                     t                                 d S r   )r   
addHandlerr   StreamHandlersetLevelr(   library_root_loggers    r   _configure_library_root_loggerr/   C   sL    244""7#8#:#:;;;  !;!=!=>>>>>r   c                  `    t                      } |                     t          j                   d S r   )r   r,   r   r   r-   s    r   _reset_library_root_loggerr1   I   s*    244  00000r   namec                 J    | t                      } t          j        |           S )a  
        Returns a logger with the specified name. This function is not supposed
        to be directly accessed by library users.

        Args:
            name (`str`, *optional*):
                The name of the logger to get, usually the filename

        Example:

    ```python
    >>> from huggingface_hub import get_logger

    >>> logger = get_logger(__file__)
    >>> logger.set_verbosity_info()
    ```
    )r   r   r   )r2   s    r   
get_loggerr4   N   s%    & | ""T"""r   c                  B    t                                                      S )a	  Return the current level for the HuggingFace Hub's root logger.

    Returns:
        Logging level, e.g., `huggingface_hub.logging.DEBUG` and
        `huggingface_hub.logging.INFO`.

    <Tip>

    HuggingFace Hub has following logging levels:

    - `huggingface_hub.logging.CRITICAL`, `huggingface_hub.logging.FATAL`
    - `huggingface_hub.logging.ERROR`
    - `huggingface_hub.logging.WARNING`, `huggingface_hub.logging.WARN`
    - `huggingface_hub.logging.INFO`
    - `huggingface_hub.logging.DEBUG`

    </Tip>
    )r   getEffectiveLevelr   r   r   get_verbosityr7   g   s    & $%%77999r   	verbosityc                 H    t                                          |            dS )z
    Sets the level for the HuggingFace Hub's root logger.

    Args:
        verbosity (`int`):
            Logging level, e.g., `huggingface_hub.logging.DEBUG` and
            `huggingface_hub.logging.INFO`.
    N)r   r,   )r8   s    r   set_verbosityr:   }   s$     ''	22222r   c                  *    t          t                    S )z/
    Sets the verbosity to `logging.INFO`.
    )r:   r   r   r   r   set_verbosity_infor<      s     r   c                  *    t          t                    S )z2
    Sets the verbosity to `logging.WARNING`.
    )r:   r
   r   r   r   set_verbosity_warningr>      s     !!!r   c                  *    t          t                    S )z0
    Sets the verbosity to `logging.DEBUG`.
    )r:   r   r   r   r   set_verbosity_debugr@           r   c                  *    t          t                    S )z0
    Sets the verbosity to `logging.ERROR`.
    )r:   r   r   r   r   set_verbosity_errorrC      rA   r   c                  ,    dt                      _        dS )zo
    Disable propagation of the library log outputs. Note that log propagation is
    disabled by default.
    FNr   	propagater   r   r   disable_propagationrG      s    
 ,1(((r   c                  ,    dt                      _        dS )z
    Enable propagation of the library log outputs. Please disable the
    HuggingFace Hub's default handler to prevent double logging if the root
    logger has been configured.
    TNrE   r   r   r   enable_propagationrI      s     ,0(((r   )r   Nr   ) __doc__r   r!   r   r   r   r   r   r   r	   r
   typingr   r#   r&   strr   Loggerr   r(   r/   r1   r4   intr7   r:   r<   r>   r@   rC   rG   rI   r   r   r   <module>rO      s      					 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	       ]L]  
 _ "3 " " " "2'. 2 2 2 2   ? ? ? ?1 1 1 1
# #Xc] #gn # # # #2:s : : : :,	3S 	3T 	3 	3 	3 	3  " " "          1 1 1 10 0 0 0            r   