§
    ùÛg{
  ã                   ó€   — d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	m
Z
mZmZ ddlmZ dZd	Zed
„ ¦   «         Zd„ Zd„ ZdS )z²
    flask.logging
    ~~~~~~~~~~~~~

    Implements the logging support for Flask.

    :copyright: (c) 2015 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
é    )Úabsolute_importN)Ú
LocalProxy)Ú	getLoggerÚStreamHandlerÚ	FormatterÚgetLoggerClassÚDEBUGÚERRORé   )Ú_request_ctx_stackz6[%(asctime)s] %(levelname)s in %(module)s: %(message)szä--------------------------------------------------------------------------------
%(levelname)s in %(module)s [%(pathname)s:%(lineno)d]:
%(message)s
--------------------------------------------------------------------------------c                  óZ   — t           j        } | �| j        j        d         S t          j        S )z§Finds the most appropriate error stream for the application.  If a
    WSGI request is in flight we log to wsgi.errors, otherwise this resolves
    to sys.stderr.
    Nzwsgi.errors)r   ÚtopÚrequestÚenvironÚsysÚstderr)Úctxs    úC/granary/edev/quantum/lib/python3.11/site-packages/flask/logging.pyÚ_proxy_streamr      s)   € õ Ô
 €CØ
€ØŒ{Ô" =Ô1Ð1ÝŒ:Ðó    c                 ó<   — | j         d         }||k    s|dk    rdS dS )NÚLOGGER_HANDLER_POLICYÚalwaysTF)Úconfig)ÚappÚmodeÚpolicys      r   Ú_should_log_forr   +   s,   € ØŒZÐ/Ô0€FØ�‚~€~˜ 8Ò+Ð+ØˆtØˆ5r   c                 ór  ‡ ‡— t          ¦   «         Š G ˆˆ fd„d‰¦  «        } G ˆ fd„dt          ¦  «        } G ˆ fd„dt          ¦  «        } |¦   «         }|                     t          ¦  «         |                     t          t          ¦  «        ¦  «          |t          ¦  «        }|                     t          ¦  «         |                     t          t          ¦  «        ¦  «         t          ‰ j        ¦  «        }|j        dd…= ||_        |                     |¦  «         |                     |¦  «         |S )a8  Creates a logger for the given application.  This logger works
    similar to a regular Python logger but changes the effective logging
    level based on the application's debug flag.  Furthermore this
    function also removes all attached handlers in case there was a
    logger with the log name before.
    c                   ó   •— e Zd Zˆ ˆfd„ZdS )ú"create_logger.<locals>.DebugLoggerc                 ó`   •— | j         dk    r‰j        rt          S ‰                     | ¦  «        S )Nr   )ÚlevelÚdebugr	   ÚgetEffectiveLevel)ÚselfÚLoggerr   s    €€r   r%   z4create_logger.<locals>.DebugLogger.getEffectiveLevel<   s-   ø€ ØŒz˜QŠˆ 3¤9ˆÝ�Ø×+Ò+¨DÑ1Ô1Ð1r   N)Ú__name__Ú
__module__Ú__qualname__r%   )r'   r   s   €€r   ÚDebugLoggerr!   ;   s3   ø€ € € € € ð	2ð 	2ð 	2ð 	2ð 	2ð 	2ð 	2ð 	2r   r+   c                   ó   •— e Zd Zˆ fd„ZdS )ú#create_logger.<locals>.DebugHandlerc                 óh   •— ‰j         r't          ‰d¦  «        rt          j        | |¦  «         d S d S d S )Nr$   ©r$   r   r   Úemit©r&   Úrecordr   s     €r   r0   z(create_logger.<locals>.DebugHandler.emitB   sK   ø€ ØŒyð 1�_¨S°'Ñ:Ô:ð 1ÝÔ" 4¨Ñ0Ô0Ð0Ð0Ð0ð1ð 1ð 1ð 1r   N©r(   r)   r*   r0   ©r   s   €r   ÚDebugHandlerr-   A   ó.   ø€ € € € € ð	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1r   r5   c                   ó   •— e Zd Zˆ fd„ZdS )ú(create_logger.<locals>.ProductionHandlerc                 óh   •— ‰j         s't          ‰d¦  «        rt          j        | |¦  «         d S d S d S )NÚ
productionr/   r1   s     €r   r0   z-create_logger.<locals>.ProductionHandler.emitG   sK   ø€ Ø”9ð 1¥°°lÑ!CÔ!Cð 1ÝÔ" 4¨Ñ0Ô0Ð0Ð0Ð0ð1ð 1ð 1ð 1r   Nr3   r4   s   €r   ÚProductionHandlerr8   F   r6   r   r;   N)r   r   ÚsetLevelr	   ÚsetFormatterr   ÚDEBUG_LOG_FORMATr   r
   ÚPROD_LOG_FORMATr   Úlogger_nameÚhandlersÚ	__class__Ú
addHandler)r   r+   r5   r;   Údebug_handlerÚprod_handlerÚloggerr'   s   `      @r   Úcreate_loggerrG   2   s„  øø€ õ ÑÔ€Fð2ð 2ð 2ð 2ð 2ð 2ð 2ð 2�fñ 2ô 2ð 2ð1ð 1ð 1ð 1ð 1ð 1ð 1•}ñ 1ô 1ð 1ð
1ð 1ð 1ð 1ð 1ð 1ð 1�Mñ 1ô 1ð 1ð
 !�L‘N”N€MØ×Ò�5Ñ!Ô!Ð!Ø×Ò�yÕ)9Ñ:Ô:Ñ;Ô;Ð;à$Ð$¥]Ñ3Ô3€LØ×Ò�%Ñ Ô Ð Ø×Ò�i­Ñ8Ô8Ñ9Ô9Ð9å�s”Ñ'Ô'€Fð 	Œ˜˜˜ÐØ"€FÔØ
×Ò�mÑ$Ô$Ð$Ø
×Ò�lÑ#Ô#Ð#Ø€Mr   )Ú__doc__Ú
__future__r   r   Úwerkzeug.localr   Úloggingr   r   r   r   r	   r
   Úglobalsr   r?   r>   r   r   rG   © r   r   ú<module>rN      sõ   ððð ð 'Ð &Ð &Ð &Ð &Ð &à 
€
€
€
à %Ð %Ð %Ð %Ð %Ð %ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð à 'Ð 'Ð 'Ð 'Ð 'Ð 'ð K€ðð ð ðð ñ „ððð ð ð(ð (ð (ð (ð (r   