%PDF- %PDF-
Direktori : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/logging.cpython-312.pyc |
� �~�e� � �T � d dl Z d dlZd dlZdZ G d� de� Zd d�Zd d�Zdd�Z d� Z y)� Nz;%(asctime)s %(levelname)-8s [%(threadName)-10s] %(message)sc � � e Zd Zy)�LoggingAttributeErrorN)�__name__� __module__�__qualname__� � �7/usr/lib/python3/dist-packages/landscape/lib/logging.pyr r s � �r r c � � | j ddddd�� d}|r |d|�d �z }| j d dd||� � | j d|d�� y)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: z).z-lz --log-dir�FILE)�metavarr r z--log-levelz/One of debug, info, warning, error or critical.)r r N)� add_option)�parser�level�logdir� logdirhelps r �add_cli_optionsr s� � � ������� 1� � � =�J� ���F�:�R�0�0� � ������� � � � ����� >� � r c � � |�0t j j t j d � }t j |j � � }t |t � r_t t j � || |t j t � |st j nd� t j � S t t j � t j | |t j t � |st j nd� d|�d|��}t j |� t# |� �)z3Given a log dir, set up logging for an application.Nr zUnknown level z!, conversion to logging code was )�os�path�basename�sys�argv�logging�getLevelName�upper� isinstance�int� _init_logging� getLogger� Formatter�FORMAT�stdout�INFO�errorr )r r �progname�quiet� levelcode�msgs r �init_app_loggingr. ( s� � ����7�7�#�#�C�H�H�Q�K�0���$�$�U�[�[�]�3�I��)�S�!������������f�%�#�C�J�J�� � � � �"�"�������L�L������f�%�#�C�J�J�� � �U�I� & � )�}� .� � � � �c��#�C�(�(r c � � | j |� t j j |� st j |� t j j ||dz � }t j |� g}|r$|j t j |� � |D ]$ }| j |� |j |� �& y )Nz.log)�setLevelr r �exists�makedirs�joinr �FileHandler�append� StreamHandler� addHandler�setFormatter) �loggerr r �logname� formatterr'