https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/loggingutil.cpython-310.pyc
o

�]Lb��@s�ddlmZddlZddlmZmZddlmZmZm	Z	ddd�Z
dd	�Zd
d�ZGdd
�d
e
�ZGdd�de
�ZGdd�de
�ZdS)�)�absolute_importN�)�encoding�pycompat)�dateutil�procutil�
stringutilc	s���fdd�}|dkrNz��|�}Wn	tyYn3w|j|krN��|�}t�|ddd�D]}|d||dfd||fd�q/|||dkoK|dd��|d	d
d�S)z{Open log file in append mode, with optional rotation

    If maxsize > 0, the log file will be rotated up to maxfiles.
    cs�z��|�Wn%ty,}z|jtjkr"��d|t�|j�f�WYd}~nd}~wwz|r9��||�WdSWdStyi}z"|jtjkr^��d||t�|j�f�WYd}~dSWYd}~dSd}~ww)Ns warning: cannot remove '%s': %s
s(warning: cannot rename '%s' to '%s': %s
)	�unlink�OSError�errno�ENOENT�debugr�
strtolocal�strerror�rename)�oldpath�newpath�err��ui�vfs��7/usr/lib/python3/dist-packages/mercurial/loggingutil.py�rotates2����������zopenlogfile.<locals>.rotaterr���s%s.%d)rrs.1�aF)�makeparentdirs)�statr
�st_size�joinr�xrange)	rr�name�maxfiles�maxsizer�st�path�irrr�openlogfiles �


�r'cCs"tjdd�}t��}d|||fS)Ns%Y/%m/%d %H:%M:%S)�formats%s (%d)> %s)r�datestrr�getpid)�msg�date�pidrrr�_formatloglineCsr.cCsd|vp||vS)N�*r)�event�trackedrrr�_matcheventIsr2c@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�
fileloggerz;Basic logger backed by physical file with optional rotationrcCs&||_||_t|�|_||_||_dS�N)�_vfs�_name�set�_trackedevents�	_maxfiles�_maxsize)�selfrr!r1r"r#rrr�__init__Ps


zfilelogger.__init__cC�t||j�Sr4�r2r8�r;r0rrrr1W�zfilelogger.trackedc
Cs�t|�}z't||j|j|j|jd��}|�|�Wd�WdS1s$wYWdStyK}z|�d|jt	�
|�f�WYd}~dSd}~ww)N)r"r#�cannot write to %s: %s
)r.r'r5r6r9r:�write�IOErrorr
r�forcebytestr)r;rr0r+�opts�line�fprrrr�logZs(�&�����zfilelogger.logN�rr��__name__�
__module__�__qualname__�__doc__r<r1rHrrrrr3Ms

r3c@�(eZdZdZdd�Zdd�Zdd�ZdS)	�fileobjectloggerz'Basic logger backed by file-like objectcCs||_t|�|_dSr4)�_fpr7r8)r;rGr1rrrr<oszfileobjectlogger.__init__cCr=r4r>r?rrrr1sr@zfileobjectlogger.trackedc
Csnt|�}z|j�|�|j��WdSty6}z|�dt�|jj�t�|�f�WYd}~dSd}~ww)NrA)	r.rQrB�flushrCr
rrDr!)r;rr0r+rErFrrrrrHvs�����zfileobjectlogger.logNrJrrrrrPls
rPc@rO)	�proxyloggerz4Forward log events to another logger to be set latercCs
d|_dSr4)�logger)r;rrrr<�s
zproxylogger.__init__cCs|jduo
|j�|�Sr4)rTr1r?rrrr1�szproxylogger.trackedcCs$|jdusJ�|j�||||�dSr4)rTrH)r;rr0r+rErrrrH�szproxylogger.logNrJrrrrrS�s
rSrI)�
__future__rr�rr�utilsrrrr'r.r2�objectr3rPrSrrrr�<module>s
*

https://t.me/RX1948 - 2025