%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/__pycache__/log.cpython-37.pyc

B

��4]%�@s�dZddlZddlZe�d�Zejejkr6e�ej�dd�Z	e
�Zdd�ZGdd	�d	e
�ZGd
d�de
�Zddd
�ZGdd�de
�ZdS)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`
and :class:`.Pool` objects, corresponds to a logger specific to that
instance only.

�NZ
sqlalchemycCs*t�tj�}|�t�d��|�|�dS)Nz.%(asctime)s %(levelname)s %(name)s %(message)s)�loggingZ
StreamHandler�sys�stdoutZsetFormatterZ	FormatterZ
addHandler)�loggerZhandler�r�A/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/log.py�_add_default_handler!srcsFt�|jd|j���fdd�|_�fdd�|_�|_t�|�|S)N�.cs��tj�S)N)�isEnabledForr�DEBUG)�self)rrr�<lambda>.�zclass_logger.<locals>.<lambda>cs��tj�S)N)r
r�INFO)r)rrrr
/r)	r�	getLogger�
__module__�__name__�_should_log_debug�_should_log_infor�_logged_classes�add)�clsr)rr�class_logger,s
rc@s eZdZdZdd�Zdd�ZdS)�
IdentifiedNcCs|j�tj�S)N)rr
rr)rrrrr8szIdentified._should_log_debugcCs|j�tj�S)N)rr
rr)rrrrr;szIdentified._should_log_info)rr�__qualname__�logging_namerrrrrrr5src@szeZdZdZejejejejd�Zdd�Z	dd�Z
dd�Zd	d
�ZeZ
dd�Zd
d�Zdd�Zdd�Zdd�Zdd�ZdS)�InstanceLoggeraA 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
    )NFT�debugcCs8||_t�|�|_|j|tjkr4|jjs4t|j�dS)N)�echorrr�	_echo_maprZhandlersr)rr�namerrr�__init__ZszInstanceLogger.__init__cOs|jtj|f|�|�dS)z/Delegate a debug call to the underlying logger.N)�logrr)r�msg�args�kwargsrrrrfszInstanceLogger.debugcOs|jtj|f|�|�dS)z/Delegate an info call to the underlying logger.N)r"rr)rr#r$r%rrr�infokszInstanceLogger.infocOs|jtj|f|�|�dS)z1Delegate a warning call to the underlying logger.N)r"rZWARNING)rr#r$r%rrr�warningpszInstanceLogger.warningcOs|jtj|f|�|�dS)zB
        Delegate an error call to the underlying logger.
        N)r"r�ERROR)rr#r$r%rrr�errorwszInstanceLogger.errorcOs"d|d<|jtj|f|�|�dS)z4Delegate an exception call to the underlying logger.��exc_infoN)r"rr()rr#r$r%rrr�	exception}szInstanceLogger.exceptioncOs|jtj|f|�|�dS)z2Delegate a critical call to the underlying logger.N)r"rZCRITICAL)rr#r$r%rrr�critical�szInstanceLogger.criticalcOsR|jjj|krdS|j|j}|tjkr2|j��}||krN|jj|||f|�dS)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)	r�manager�disablerrr�NOTSET�getEffectiveLevelZ_log)r�levelr#r$r%Zselected_levelrrrr"�s

zInstanceLogger.logcCs|jjj|krdS||��kS)z)Is this logger enabled for level 'level'?F)rr.r/r1)rr2rrrr
�szInstanceLogger.isEnabledForcCs$|j|j}|tjkr |j��}|S)z+What's the effective level for this logger?)rrrr0rr1)rr2rrrr1�s

z InstanceLogger.getEffectiveLevelN)rrr�__doc__rr0rrrr!rr&r'�warnr)r,r-r"r
r1rrrrr?s 
rcCsb|jr d|jj|jj|jf}nd|jj|jjf}||_|dkrNt�|�}n
t||�}||_dS)zEcreate a logger for an instance that implements :class:`.Identified`.z%s.%s.%sz%s.%s)FNN)	r�	__class__rr�_echorrrr)�instance�echoflagr rrrr�instance_logger�s
r9c@s eZdZdZdd�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``.
    cCs|dkr|S|jSdS)N)r6)rr7�ownerrrr�__get__�szecho_property.__get__cCst||d�dS)N)r8)r9)rr7�valuerrr�__set__�szecho_property.__set__N)rrrr3r<r>rrrrr:�s	r:)N)r3rrrZ
rootloggerr2r0ZsetLevelZWARNr�setrr�objectrrr9r:rrrr�<module>s
	
o


Zerion Mini Shell 1.0