U
    M8c                     @   s>   d dl Z dae eZG dd dZG dd dZdd ZdS )    Nc                   @   s   e Zd Zdd ZdS )BaseHistoryHandlerc                 C   s   t dd S )Nzemit())NotImplementedError)self
event_typepayloadsource r   4/tmp/pip-unpacked-wheel-ozje0y8b/botocore/history.pyemit   s    zBaseHistoryHandler.emitN)__name__
__module____qualname__r
   r   r   r   r	   r      s   r   c                   @   s6   e Zd Zdd Zdd Zdd Zdd Zdd
dZdS )HistoryRecorderc                 C   s   d| _ g | _d S NF)_enabled	_handlersr   r   r   r	   __init__   s    zHistoryRecorder.__init__c                 C   s
   d| _ d S )NTr   r   r   r   r	   enable   s    zHistoryRecorder.enablec                 C   s
   d| _ d S r   r   r   r   r   r	   disable    s    zHistoryRecorder.disablec                 C   s   | j | d S N)r   append)r   handlerr   r   r	   add_handler#   s    zHistoryRecorder.add_handlerBOTOCOREc              	   C   sT   | j rP| jrP| jD ]<}z|||| W q tk
rL   tjd|dd Y qX qd S )NzException raised in %s.T)exc_info)r   r   r
   	Exceptionloggerdebug)r   r   r   r   r   r   r   r	   record&   s    
  zHistoryRecorder.recordN)r   )r   r   r   r   r   r   r   r    r   r   r   r	   r      s
   r   c                   C   s   t d krt a t S r   )HISTORY_RECORDERr   r   r   r   r	   get_global_history_recorder3   s    r"   )loggingr!   	getLoggerr   r   r   r   r"   r   r   r   r	   <module>   s
   
