U
    ´.¬b\  ã                   @   s†   d dl Z d dlmZ d dlmZ dZdZdadd„ Zde j	dfd	d
„Z
dd„ Zdd„ Zdd„ ZG dd„ de jƒZe  d¡ eƒ ¡ dS )é    N)Ú_warn_deprecated_python)ÚSessionzAmazon Web Servicesz1.24.11c                  K   s   t f | ŽadS )zâ
    Set up a default session, passing through any parameters to the session
    constructor. There is no need to call this unless you wish to pass custom
    parameters, because a default session will be created for you.
    N)r   ÚDEFAULT_SESSION)Úkwargs© r   ú2/tmp/pip-unpacked-wheel-7h_bjh9e/boto3/__init__.pyÚsetup_default_session   s    r   Zboto3c                 C   sT   |dkrd}t  | ¡}| |¡ t  ¡ }| |¡ t  |¡}| |¡ | |¡ dS )a  
    Add a stream handler for the given name and level to the logging module.
    By default, this logs all boto3 messages to ``stdout``.

        >>> import boto3
        >>> boto3.set_stream_logger('boto3.resources', logging.INFO)

    For debugging purposes a good choice is to set the stream logger to ``''``
    which is equivalent to saying "log everything".

    .. WARNING::
       Be aware that when logging anything from ``'botocore'`` the full wire
       trace will appear in your logs. If your payloads contain sensitive data
       this should not be used in production.

    :type name: string
    :param name: Log name
    :type level: int
    :param level: Logging level, e.g. ``logging.INFO``
    :type format_string: str
    :param format_string: Log message format
    Nz0%(asctime)s %(name)s [%(levelname)s] %(message)s)ÚloggingÚ	getLoggerÚsetLevelÚStreamHandlerÚ	FormatterÚsetFormatterÚ
addHandler)ÚnameÚlevelÚformat_stringÚloggerÚhandlerÚ	formatterr   r   r   Úset_stream_logger%   s    




r   c                   C   s   t dkrtƒ  tƒ  t S )z‹
    Get the default session, creating one if needed.

    :rtype: :py:class:`~boto3.session.Session`
    :return: The default session
    N)r   r   r   r   r   r   r   Ú_get_default_sessionH   s    r   c                  O   s   t ƒ j| |ŽS )z€
    Create a low-level service client by name using the default session.

    See :py:meth:`boto3.session.Session.client`.
    )r   Úclient©Úargsr   r   r   r   r   V   s    r   c                  O   s   t ƒ j| |ŽS )z�
    Create a resource service client by name using the default session.

    See :py:meth:`boto3.session.Session.resource`.
    )r   Úresourcer   r   r   r   r   _   s    r   c                   @   s   e Zd Zdd„ ZdS )ÚNullHandlerc                 C   s   d S )Nr   )ÚselfÚrecordr   r   r   Úemitk   s    zNullHandler.emitN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   j   s   r   )r	   Zboto3.compatr   Zboto3.sessionr   Ú
__author__Ú__version__r   r   ÚDEBUGr   r   r   r   ÚHandlerr   r
   r   r   r   r   r   Ú<module>   s   
#	