
    5h!                    0   % S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  \(       a  Sr\(       a  SOSrOSrSr\" SSS9r\S\\S   4   r\R.                  " S5      r\R2                  \R4                  :X  a  \R7                  \R8                  5        S"S jr\" 5       rS\ S'   S#S jr!S$S jr"\\RF                  S4   r$ " S S5      r% " S S5      r& S%     S&S jjr' " S  S!5      r(g)'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)Optional)overload)Set)Type)TypeVar)Union   )py311)py38)LiteralT   F_IT
Identified)bounddebug
sqlalchemyc                    [         R                  " [        R                  5      nUR	                  [         R
                  " S5      5        U R                  U5        g )Nz.%(asctime)s %(levelname)s %(name)s %(message)s)loggingStreamHandlersysstdoutsetFormatter	Formatter
addHandler)loggerhandlers     Y/var/www/html/cementerio_25MayoBackend/env/lib/python3.13/site-packages/sqlalchemy/log.py_add_default_handlerr    :   sC    ##CJJ/GJK g    zSet[Type[Identified]]_logged_classesc                b    [        U SS 5      =(       d    U R                  S-   U R                  -   $ )N_sqla_logger_namespace.)getattr
__module____name__)clss    r   _qual_logger_name_for_clsr*   E   s.    -t4 	/>>C#,,.r!   c                   ^ [         R                  " [        U 5      5      mU4S jU l        U4S jU l        TU l        [        R                  U 5        U $ )Nc                B   > TR                  [        R                  5      $ N)isEnabledForr   DEBUGselfr   s    r   <lambda>class_logger.<locals>.<lambda>N   s    )<)<*r!   c                B   > TR                  [        R                  5      $ r-   )r.   r   INFOr0   s    r   r2   r3   Q   s    (;(;)r!   )r   	getLoggerr*   _should_log_debug_should_log_infor   r"   add)r)   r   s    @r   class_loggerr:   L   sI    8=>FCC CJJr!   InstanceLoggerc                  P    \ rS rSr% SrSrS\S'   S\S'   S\S	'   SS
 jrSS jrSr	g)r   \    NzOptional[str]logging_name_IdentifiedLoggerTyper   _EchoFlagType_echoc                T    U R                   R                  [        R                  5      $ r-   )r   r.   r   r/   r1   s    r   r7   Identified._should_log_debuge   s    {{''66r!   c                T    U R                   R                  [        R                  5      $ r-   )r   r.   r   r5   rD   s    r   r8   Identified._should_log_infoh   s    {{''55r!   )returnbool)
r(   r'   __qualname____firstlineno__	__slots__r?   __annotations__r7   r8   __static_attributes__r>   r!   r   r   r   \   s'    I"&L-&!!76r!   c                      \ rS rSr% Sr\R                  \R                  \R                  \R                  S.r	S\
S'   SrSS jrSS jrSS	 jrSS
 jr\rSS jrSS jrSS jrSS jrSS jrSS jrSrg)r;   l   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   rA   rB   )echor   c                    Xl         [        R                  " U5      U l        U R                  U   [        R
                  ::  a2  U R                  R                  (       d  [        U R                  5        g g g r-   )rQ   r   r6   r   	_echo_mapr5   handlersr    )r1   rQ   names      r   __init__InstanceLogger.__init__   sQ    	''- >>$7<</8L8L - 9M/r!   c                N    U R                   " [        R                  U/UQ70 UD6  g)z/Delegate a debug call to the underlying logger.N)logr   r/   r1   msgargskwargss       r   r   InstanceLogger.debug   s      	5d5f5r!   c                N    U R                   " [        R                  U/UQ70 UD6  g)z/Delegate an info call to the underlying logger.N)rY   r   r5   rZ   s       r   infoInstanceLogger.info   s      	s4T4V4r!   c                N    U R                   " [        R                  U/UQ70 UD6  g)z1Delegate a warning call to the underlying logger.N)rY   r   WARNINGrZ   s       r   warningInstanceLogger.warning   s      	#777r!   c                N    U R                   " [        R                  U/UQ70 UD6  g)z2
Delegate an error call to the underlying logger.
NrY   r   ERRORrZ   s       r   errorInstanceLogger.error   s      	5d5f5r!   c                X    SUS'   U R                   " [        R                  U/UQ70 UD6  g)z4Delegate an exception call to the underlying logger.r   exc_infoNrg   rZ   s       r   	exceptionInstanceLogger.exception   s*     z5d5f5r!   c                N    U R                   " [        R                  U/UQ70 UD6  g)z2Delegate a critical call to the underlying logger.N)rY   r   CRITICALrZ   s       r   criticalInstanceLogger.critical   s"     	!!3888r!   c                r   U R                   R                  R                  U:  a  gU R                  U R                     nU[
        R                  :X  a  U R                   R                  5       nX:  aF  [        (       a  UR                  SS5      [        -   US'   U R                   R                  " XU40 UD6  gg)zDelegate 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disablerS   rQ   r   NOTSETgetEffectiveLevel
STACKLEVELgetSTACKLEVEL_OFFSET_log)r1   levelr[   r\   r]   selected_levels         r   rY   InstanceLogger.log   s     ;;&&%/		2W^^+![[::<N"zJJ|Q/2CC |$ KKU88 #r!   c                p    U R                   R                  R                  U:  a  gXR                  5       :  $ )z)Is this logger enabled for level 'level'?F)r   ru   rv   rx   r1   r}   s     r   r.   InstanceLogger.isEnabledFor   s1     ;;&&%/..000r!   c                    U R                   U R                     nU[        R                  :X  a  U R                  R                  5       nU$ )z+What's the effective level for this logger?)rS   rQ   r   rw   r   rx   r   s     r   rx    InstanceLogger.getEffectiveLevel   s9     tyy)GNN"KK113Er!   N)rQ   rA   rU   str)r[   r   r\   r   r]   r   rH   None)
r}   intr[   r   r\   r   r]   r   rH   r   )r}   r   rH   rI   )rH   r   )r(   r'   rJ   rK   __doc__r   rw   r5   r/   rS   rM   rL   rV   r   r`   rd   warnri   rm   rq   rY   r.   rx   rN   r>   r!   r   r;   r;   l   sr    ( nn~~ll	I "I.6
5
8
 D669
961r!   c                   U R                   (       a'  [        U R                  5      < SU R                   < 3nO[        U R                  5      nXl        US;   a  [        R
                  " U5      nO[        X5      nX0l        g)zEcreate a logger for an instance that implements :class:`.Identified`.r%   )FNN)r?   r*   	__class__rB   r   r6   r;   r   )instanceechoflagrU   r   s       r   instance_loggerr      so    
 %h&8&89!!

 )););<N =  ""4(
  /Or!   c                  x    \ rS rSrSr\      S	S j5       r\      S
S j5       r      SS jrSS jrSrg)echo_propertyi  a}      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                    g r-   r>   r1   r   owners      r   __get__echo_property.__get__       r!   c                    g r-   r>   r   s      r   r   r     r   r!   c                $    Uc  U $ UR                   $ r-   )rB   r   s      r   r   r     s     K>>!r!   c                    [        XS9  g )N)r   )r   )r1   r   values      r   __set__echo_property.__set__  s
    1r!   r>   N)r   zLiteral[None]r   Type[Identified]rH   r   )r   r   r   r   rH   rA   )r   zOptional[Identified]r   r   rH   z#Union[echo_property, _EchoFlagType])r   r   r   rA   rH   r   )	r(   r'   rJ   rK   r   r   r   r   rN   r>   r!   r   r   r     s    G %.>	  "+;	 ","5E"	,"2r!   r   )r   zlogging.LoggerrH   r   )r)   r   rH   r   )r)   	Type[_IT]rH   r   r-   )r   r   r   rA   rH   r   ))r   
__future__r   r   r   typingr   r   r   r   r   r	   r
   utilr   r   util.typingr   ry   r{   r   rI   rA   r6   
rootloggerr}   rw   setLevelWARNr    setr"   rM   r*   r:   Loggerr@   r   r;   r   r   r>   r!   r   <module>r      s$  
 #  
            J #Je<(dD''"223
 |,
w~~%% *-& .
 gnn.>>? 6 6 u ur 59$1	<2 2r!   