Ë
    r™ãjö   ã                  óè  — U d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ dZdZ edd¬«      Zedeed   f   Z ej&                  d«      Zej*                  ej,                  k(  rej/                  ej0                  «       dd„Z e«       Zded<   dd„Zd d„Zeej>                  df   Z  G d„ d«      Z! G d„ d«      Z"	 d!	 	 	 	 	 d"d„Z# G d„ d«      Z$y)#a”  Logging control and utilities.

Control of logging for SA can be performed from the regular python logging
module.  The regular dotted module namespace is used, starting at
'sqlalchemy'.  For class-level logging, the class name is appended.

The "echo" keyword parameter, available on SQLA :class:`_engine.Engine`
and :class:`_pool.Pool` objects, corresponds to a logger specific to that
instance only.

é    )ÚannotationsN)ÚAny)ÚLiteral)ÚOptional)Úoverload)ÚSet)ÚType)ÚTypeVar)ÚUnionTé   Ú_ITÚ
Identified)ÚboundÚdebugÚ
sqlalchemyc                ó´   — t        j                  t        j                  «      }|j	                  t        j
                  d«      «       | j                  |«       y )Nz.%(asctime)s %(levelname)s %(name)s %(message)s)ÚloggingÚStreamHandlerÚsysÚstdoutÚsetFormatterÚ	FormatterÚ
addHandler)ÚloggerÚhandlers     úY/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/sqlalchemy/log.pyÚ_add_default_handlerr   1   sC   € Ü×#Ñ#¤C§J¡JÓ/€GØ×ÑÜ×ÑÐJÓKôð ×Ñ�gÕó    zSet[Type[Identified]]Ú_logged_classesc                óX   — t        | dd «      xs | j                  dz   | j                  z   S )NÚ_sqla_logger_namespaceú.)ÚgetattrÚ
__module__Ú__name__)Úclss    r   Ú_qual_logger_name_for_clsr'   <   s.   € ä�Ð-¨tÓ4ò 	/Ø�>‰>˜CÑ #§,¡,Ñ.ðr   c                ó¤   ‡— t        j                  t        | «      «      Šˆfd„| _        ˆfd„| _        ‰| _        t        j                  | «       | S )Nc                óB   •— ‰j                  t        j                  «      S ©N)ÚisEnabledForr   ÚDEBUG©Úselfr   s    €r   ú<lambda>zclass_logger.<locals>.<lambda>E   s   ø€ ¨×)<Ñ)<Ü�‰ó*€ r   c                óB   •— ‰j                  t        j                  «      S r*   )r+   r   ÚINFOr-   s    €r   r/   zclass_logger.<locals>.<lambda>H   s   ø€ ¨×(;Ñ(;Ü�‰ó)€ r   )r   Ú	getLoggerr'   Ú_should_log_debugÚ_should_log_infor   r   Úadd)r&   r   s    @r   Úclass_loggerr6   C   sI   ø€ Ü×ÑÔ8¸Ó=Ó>€Fó€CÔó€CÔð €C„JÜ×Ñ˜ÔØ€Jr   ÚInstanceLoggerc                  óD   — e Zd ZU dZdZded<   ded<   ded<   dd	„Zdd
„Zy)r   © NzOptional[str]Úlogging_nameÚ_IdentifiedLoggerTyper   Ú_EchoFlagTypeÚ_echoc                óT   — | j                   j                  t        j                  «      S r*   )r   r+   r   r,   ©r.   s    r   r3   zIdentified._should_log_debug\   s   € Ø�{‰{×'Ñ'¬¯©Ó6Ð6r   c                óT   — | j                   j                  t        j                  «      S r*   )r   r+   r   r1   r?   s    r   r4   zIdentified._should_log_info_   s   € Ø�{‰{×'Ñ'¬¯©Ó5Ð5r   )ÚreturnÚbool)r%   r$   Ú__qualname__Ú	__slots__r:   Ú__annotations__r3   r4   r9   r   r   r   r   S   s'   … Ø€Ià"&€L�-Ó&à!Ó!àÓó7ô6r   c                  óÒ   — e Zd ZU dZej
                  ej
                  ej                  ej                  dœZde	d<   dZ
dd„Zdd„Zdd„Zdd	„ZeZdd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zy)r7   a  A logger adapter (wrapper) for :class:`.Identified` subclasses.

    This allows multiple instances (e.g. Engine or Pool instances)
    to share a logger, but have its verbosity controlled on a
    per-instance basis.

    The basic functionality is to return a logging level
    which is based on an instance's echo setting.

    Default implementation is:

    'debug' -> logging.DEBUG
    True    -> logging.INFO
    False   -> Effective level of underlying logger (
    logging.WARNING by default)
    None    -> same as False
    )NFTr   r<   r=   )Úechor   c                óà   — || _         t        j                  |«      | _        | j                  |   t        j
                  k  r-| j                  j                  st        | j                  «       y y y r*   )rG   r   r2   r   Ú	_echo_mapr1   Úhandlersr   )r.   rG   Únames      r   Ú__init__zInstanceLogger.__init__‚   sS   € ØˆŒ	Ü×'Ñ'¨Ó-ˆŒð �>‰>˜$Ñ¤7§<¡<Ò/¸¿¹×8LÒ8LÜ  §¡Õ-ð 9MÐ/r   c                óN   —  | j                   t        j                  |g|¢­i |¤Ž y)z/Delegate a debug call to the underlying logger.N)Úlogr   r,   ©r.   ÚmsgÚargsÚkwargss       r   r   zInstanceLogger.debugŽ   s"   € ð 	ˆ�‰”—‘ Ð5 dÒ5¨fÓ5r   c                óN   —  | j                   t        j                  |g|¢­i |¤Ž y)z/Delegate an info call to the underlying logger.N)rN   r   r1   rO   s       r   ÚinfozInstanceLogger.info“   s"   € ð 	ˆ�‰”—‘˜sÐ4 TÒ4¨VÓ4r   c                óN   —  | j                   t        j                  |g|¢­i |¤Ž y)z1Delegate a warning call to the underlying logger.N)rN   r   ÚWARNINGrO   s       r   ÚwarningzInstanceLogger.warning˜   s"   € ð 	ˆ�‰”—‘ #Ð7¨Ò7°Ó7r   c                óN   —  | j                   t        j                  |g|¢­i |¤Ž y)zB
        Delegate an error call to the underlying logger.
        N©rN   r   ÚERRORrO   s       r   ÚerrorzInstanceLogger.errorŸ   s"   € ð 	ˆ�‰”—‘ Ð5 dÒ5¨fÓ5r   c                óX   — d|d<    | j                   t        j                  |g|¢­i |¤Ž y)z4Delegate an exception call to the underlying logger.é   Úexc_infoNrY   rO   s       r   Ú	exceptionzInstanceLogger.exception¥   s,   € ð ˆˆzÑØˆ�‰”—‘ Ð5 dÒ5¨fÓ5r   c                óN   —  | j                   t        j                  |g|¢­i |¤Ž y)z2Delegate a critical call to the underlying logger.N)rN   r   ÚCRITICALrO   s       r   ÚcriticalzInstanceLogger.critical«   s$   € ð 	ˆ�‰”×!Ñ! 3Ð8¨Ò8°Ó8r   c                óf  — | j                   j                  j                  |k\  ry| j                  | j                     }|t
        j                  k(  r| j                   j                  «       }||k\  rBt        r|j                  dd«      t        z   |d<    | j                   j                  |||fi |¤Ž yy)zÎDelegate a log call to the underlying logger.

        The level here is determined by the echo
        flag as well as that of the underlying logger, and
        logger._log() is called directly.

        NÚ
stacklevelr]   )r   ÚmanagerÚdisablerI   rG   r   ÚNOTSETÚgetEffectiveLevelÚ
STACKLEVELÚgetÚSTACKLEVEL_OFFSETÚ_log)r.   ÚlevelrP   rQ   rR   Úselected_levels         r   rN   zInstanceLogger.log°   sœ   € ð �;‰;×Ñ×&Ñ&¨%Ò/ØàŸ™¨¯	©	Ñ2ˆØœWŸ^™^Ò+Ø!Ÿ[™[×:Ñ:Ó<ˆNà�NÒ"Ýà—J‘J˜|¨QÓ/Ô2CÑCð �|Ñ$ð ˆD�K‰K×Ñ˜U C¨Ñ8°Ó8ð #r   c                óp   — | j                   j                  j                  |k\  ry|| j                  «       k\  S )z)Is this logger enabled for level 'level'?F)r   re   rf   rh   ©r.   rm   s     r   r+   zInstanceLogger.isEnabledForË   s3   € ð �;‰;×Ñ×&Ñ&¨%Ò/ØØ˜×.Ñ.Ó0Ñ0Ð0r   c                ó’   — | j                   | j                     }|t        j                  k(  r| j                  j                  «       }|S )z+What's the effective level for this logger?)rI   rG   r   rg   r   rh   rp   s     r   rh   z InstanceLogger.getEffectiveLevelÒ   s9   € ð —‘˜tŸy™yÑ)ˆØ”G—N‘NÒ"Ø—K‘K×1Ñ1Ó3ˆEØˆr   N)rG   r<   rK   Ústr)rP   rr   rQ   r   rR   r   rA   ÚNone)
rm   ÚintrP   rr   rQ   r   rR   r   rA   rs   )rm   rt   rA   rB   )rA   rt   )r%   r$   rC   Ú__doc__r   rg   r1   r,   rI   rE   rD   rL   r   rT   rW   Úwarnr[   r_   rb   rN   r+   rh   r9   r   r   r7   r7   c   sr   … ñð( �n‰nØ�~‰~Ø�l‰lØ—‘ñ	€Ið Óà"€Ió.ó6ó
5ó
8ð
 €Dó6ó6ó9ó
9ó61ôr   c                ó  — | j                   r%t        | j                  «      ›d| j                   ›�}nt        | j                  «      }|| _        |dv rt	        j
                  |«      }|| _        yt        ||«      }|| _        y)zEcreate a logger for an instance that implements :class:`.Identified`.r"   )FNN)r:   r'   Ú	__class__r=   r   r2   r7   r   )ÚinstanceÚechoflagrK   r   s       r   Úinstance_loggerr{   Û   s~   € ð
 ×Òä% h×&8Ñ&8Õ9Ø×!Ò!ð
‰ô
 )¨×);Ñ);Ó<ˆà€H„Nð �=Ñ ô ×"Ñ" 4Ó(ˆð €H…Oô   ¨$Ó/ˆà€H…Or   c                  óh   — e Zd ZdZe	 	 	 	 	 	 dd„«       Ze	 	 	 	 	 	 dd„«       Z	 	 	 	 	 	 d	d„Zd
d„Zy)Úecho_propertya}      When ``True``, enable log output for this element.

    This has the effect of setting the Python logging level for the namespace
    of this element's class and object reference.  A value of boolean ``True``
    indicates that the loglevel ``logging.INFO`` will be set for the logger,
    whereas the string value ``debug`` will set the loglevel to
    ``logging.DEBUG``.
    c                 ó   — y r*   r9   ©r.   ry   Úowners      r   Ú__get__zecho_property.__get__  ó   € ð r   c                 ó   — y r*   r9   r   s      r   r�   zecho_property.__get__	  r‚   r   c                ó"   — |€| S |j                   S r*   )r=   r   s      r   r�   zecho_property.__get__  s   € ð ÐØˆKà—>‘>Ð!r   c                ó   — t        ||¬«       y )N)rz   )r{   )r.   ry   Úvalues      r   Ú__set__zecho_property.__set__  s   € Ü˜¨5Ö1r   N)ry   zLiteral[None]r€   úType[Identified]rA   r}   )ry   r   r€   rˆ   rA   r<   )ry   zOptional[Identified]r€   rˆ   rA   z#Union[echo_property, _EchoFlagType])ry   r   r†   r<   rA   rs   )r%   r$   rC   ru   r   r�   r‡   r9   r   r   r}   r}   ù   sƒ   „ ð€Gð ðØ%ðØ.>ðà	òó ðð ðØ"ðØ+;ðà	òó ðð"Ø,ð"Ø5Eð"à	,ó"ô2r   r}   )r   zlogging.LoggerrA   rs   )r&   rˆ   rA   rr   )r&   ú	Type[_IT]rA   r‰   r*   )ry   r   rz   r<   rA   rs   )%ru   Ú
__future__r   r   r   Útypingr   r   r   r   r   r	   r
   r   ri   rk   r   rB   r<   r2   Ú
rootloggerrm   rg   ÚsetLevelrV   r   Úsetr   rE   r'   r6   ÚLoggerr;   r   r7   r{   r}   r9   r   r   ú<module>r�      s
  ðò
õ #ã Û 
Ý Ý Ý Ý Ý Ý Ý Ý à€
ØÐ áˆe˜<Ô(€à�d˜D '¨'Ñ"2Ð2Ñ3€ð
 ˆW×Ñ˜|Ó,€
Ø×Ñ�w—~‘~Ò%Ø×Ñ˜Ÿ™Ô(óñ *-«€Ð&Ó .óó
ð ˜gŸn™nÐ.>Ð>Ñ?Ð ÷6ñ 6÷ uñ uðr 59ðØðØ$1ðà	ó÷<2ò 2r   