HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/boto/__pycache__/requestlog.cpython-310.pyc
o

we��@sTddlZddlmZddlmZddlZddlmZddlmZGdd�de�Z	dS)�N)�datetime)�Thread)�RequestHook)�	long_typec@s,eZdZdZddd�Zddd�Zdd	�Zd
S)
�
RequestLoggerzf
    This class implements a request logger that uses a single thread to
    write to a log file.
    �/tmp/request_log.csvcCs,t|d�|_t�d�|_t|jd���dS)N�w�d)�target)�open�request_log_file�Queue�request_log_queuer�_request_log_worker�start)�self�filename�r�H/home/arjun/projects/env/lib/python3.10/site-packages/boto/requestlog.py�__init__szRequestLogger.__init__Fc		Csz|rdn|�d�}t��}|�d�}||j}|jt|j|jdd�dd}|j	�
d||j|||jdf�dS)	NrzContent-Lengthz%Y-%m-%d %H:%M:%S�ig��.Az'%s', '%s', '%s', '%s', '%s'
�Action)
�	getheaderr�now�strftime�
start_time�microsecondsr�seconds�daysr�put�status�params)	r�request�response�error�lenr�time�td�durationrrr�handle_request_datas

&&z!RequestLogger.handle_request_datacCsT	z|j�d�}|j�|�|j��|j��Wnddl}|jtj	d�Yq)NTr)�file)
r�getr�write�flush�	task_done�	traceback�	print_exc�sys�stdout)r�itemr/rrrrs
�z!RequestLogger._request_log_workerN)r)F)�__name__�
__module__�__qualname__�__doc__rr)rrrrrr
s



r)
r1r�	threadingrr
�
boto.utilsr�boto.compatrrrrrr�<module>s