� g\�g�!���UdZddlmZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z dd lm Z d d l mZd d l mZd dlmZer dZerdnd ZndZdZe dd���Ze deedfZejd��Zejejkre�ej��d-d�Ze��Zde d<d.d!�Z!d/d#�Z"e ej#d$fZ$Gd%�d��Z%Gd&�d$��Z& d0d1d*�Z'Gd+�d,��Z(dS)2a�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� sqlalchemy�logger�logging.Logger�return�Nonec��tjtj��}|�tjd����|�|��dS)Nz.%(asctime)s %(levelname)s %(name)s %(message)s)�logging� StreamHandler�sys�stdout� setFormatter� Formatter� addHandler)r�handlers �^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sqlalchemy/log.py�_add_default_handlerr#:sW���#�C�J�/�/�G� �����J�K�K���� ���g������zSet[Type[Identified]]�_logged_classes�cls�Type[Identified]�strc�H�t|dd��p|jdz|jzS)N�_sqla_logger_namespace�.)�getattr� __module__�__name__)r&s r"�_qual_logger_name_for_clsr/Es-����-�t�4�4� /� �>�C� �#�,� .�r$� Type[_IT]c���tjt|������fd�|_�fd�|_�|_t �|��|S)Nc�B����tj��S�N)� isEnabledForr�DEBUG��selfrs �r"�<lambda>zclass_logger.<locals>.<lambda>Ns����)<�)<�� �*�*�r$c�B����tj��Sr3)r4r�INFOr6s �r"r8zclass_logger.<locals>.<lambda>Qs����(;�(;�� �)�)�r$)r� getLoggerr/�_should_log_debug�_should_log_inforr%�add)r&rs @r"� class_loggerr?Lsp��� � �8��=�=� >� >�F�����C������C���C�J�������� �Jr$�InstanceLoggerc�F�eZdZUdZdZded<ded<ded<d d �Zd d �ZdS)r�Nz Optional[str]� logging_name�_IdentifiedLoggerTyper� _EchoFlagType�_echor�boolc�J�|j�tj��Sr3)rr4rr5�r7s r"r<zIdentified._should_log_debuges���{�'�'�� �6�6�6r$c�J�|j�tj��Sr3)rr4rr:rIs r"r=zIdentified._should_log_infohs���{�'�'�� �5�5�5r$)rrG)r.r-� __qualname__� __slots__rC�__annotations__r<r=rBr$r"rr\sl��������I�"&�L�&�&�&�&�!�!�!�!�����7�7�7�7�6�6�6�6�6�6r$c��eZdZUdZejejejejd�Zde d<dZ dd �Z dd�Z dd�Z dd�ZeZdd�Zdd�Zdd�Zdd�Zd d�Zd!d�ZdS)"r@aA 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 )NFTrrErF)�echorrO�namer(c���||_tj|��|_|j|tjkr"|jjst|j��dSdSdSr3)rOrr;r� _echo_mapr:�handlersr#)r7rOrPs r"�__init__zInstanceLogger.__init__�s_���� ��'��-�-�� � �>�$� �7�<� /� /�� �8L� /� ��� -� -� -� -� -� 0� /� /� /r$�msg�argsr�kwargsrrc�>�|jtj|g|�Ri|��dS)z/Delegate a debug call to the underlying logger.N)�logrr5�r7rUrVrWs r"rzInstanceLogger.debug�s0�� ������5�d�5�5�5�f�5�5�5�5�5r$c�>�|jtj|g|�Ri|��dS)z/Delegate an info call to the underlying logger.N)rYrr:rZs r"�infozInstanceLogger.info�s0�� �����s�4�T�4�4�4�V�4�4�4�4�4r$c�>�|jtj|g|�Ri|��dS)z1Delegate a warning call to the underlying logger.N)rYr�WARNINGrZs r"�warningzInstanceLogger.warning�s0�� �����#�7��7�7�7��7�7�7�7�7r$c�>�|jtj|g|�Ri|��dS)zB Delegate an error call to the underlying logger. N�rYr�ERRORrZs r"�errorzInstanceLogger.error�s0�� ������5�d�5�5�5�f�5�5�5�5�5r$c�H�d|d<|jtj|g|�Ri|��dS)z4Delegate an exception call to the underlying logger.r �exc_infoNrarZs r"� exceptionzInstanceLogger.exception�s:����z��������5�d�5�5�5�f�5�5�5�5�5r$c�>�|jtj|g|�Ri|��dS)z2Delegate a critical call to the underlying logger.N)rYr�CRITICALrZs r"�criticalzInstanceLogger.critical�s1�� ����!�3�8��8�8�8��8�8�8�8�8r$�level�intc�4�|jjj|krdS|j|j}|t jkr|j���}||kr?tr!|� dd��tz|d<|jj |||fi|��dSdS)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�disablerRrOr�NOTSET�getEffectiveLevel� STACKLEVEL�get�STACKLEVEL_OFFSET�_log)r7rjrUrVrW�selected_levels r"rYzInstanceLogger.log�s��� �;� � &�%� /� /� �F���� �2�� �W�^� +� +�!�[�:�:�<�<�N� �N� "� "�� ��J�J�|�Q�/�/�2C�C��|�$� �D�K� �U�C�� 8� 8�� 8� 8� 8� 8� 8� #� "r$rGc�`�|jjj|krdS||���kS)z)Is this logger enabled for level 'level'?F)rrnrorq�r7rjs r"r4zInstanceLogger.isEnabledFor�s3�� �;� � &�%� /� /��5���.�.�0�0�0�0r$c�|�|j|j}|tjkr|j���}|S)z+What's the effective level for this logger?)rRrOrrprrqrxs r"rqz InstanceLogger.getEffectiveLevel�s7����t�y�)�� �G�N� "� "��K�1�1�3�3�E�� r$N)rOrErPr()rUr(rVrrWrrr) rjrkrUr(rVrrWrrr)rjrkrrG)rrk)r.r-rK�__doc__rrpr:r5rRrMrLrTrr\r_�warnrcrfrirYr4rqrBr$r"r@r@ls$���������(�n��~��l��� ��I�����"�I�.�.�.�.�6�6�6�6� 5�5�5�5� 8�8�8�8� �D�6�6�6�6� 6�6�6�6� 9�9�9�9� 9�9�9�9�61�1�1�1������r$�instance�echoflagrEc���|jrt|j���d|j��}nt|j��}||_|dvrt j|��}nt ||��}||_dS)zEcreate a logger for an instance that implements :class:`.Identified`.r+)FNN)rCr/� __class__rFrr;r@r)r|r}rPrs r"�instance_loggerr��s��� ��=� %�h�&8� 9� 9� 9� 9� � !� !� ��� )��);�<�<���H�N��=� � ��"�4�(�(���  ��$�/�/���H�O�O�Or$c�R�eZdZdZedd���Zedd ���Zdd �Zdd�ZdS)� 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``. r|� Literal[None]�ownerr'rc��dSr3rB�r7r|r�s r"�__get__zecho_property.__get__ � ���r$rrEc��dSr3rBr�s r"r�zecho_property.__get__r�r$�Optional[Identified]�#Union[echo_property, _EchoFlagType]c��|�|S|jSr3)rFr�s r"r�zecho_property.__get__s�� � ��K��>� !r$�valuerc�(�t||���dS)N)r})r�)r7r|r�s r"�__set__zecho_property.__set__s����5�1�1�1�1�1�1r$N)r|r�r�r'rr�)r|rr�r'rrE)r|r�r�r'rr�)r|rr�rErr)r.r-rKrzrr�r�rBr$r"r�r�s��������G������X�������X��"�"�"�"�2�2�2�2�2�2r$r�)rrrr)r&r'rr()r&r0rr0r3)r|rr}rErr))rz� __future__rrr�typingrrrrrr r �utilr r � util.typingrrrrtrrGrEr;� rootloggerrjrp�setLevel�WARNr#�setr%rMr/r?�LoggerrDrr@r�r�rBr$r"�<module>r�s��� � � �#�"�"�"�"�"����� � � � ������������������������������������������������������� � � � � � ����J�#�)�������J��� �g�e�<�(�(�(���d�D�'�'�"2�2�3� � �W� �|� ,� ,� � ��w�~�%�%����� �%�%�%�����*-�����.�.�.�.����� � � � ��g�n�.>�>�?�� 6� 6� 6� 6� 6� 6� 6� 6� u�u�u�u�u�u�u�u�r59������<2�2�2�2�2�2�2�2�2�2r$
Memory