관리-도구
편집 파일: logsetup.cpython-311.pyc
� �Cg � �� � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z e j e j e j e j e j d�Zdadadadade j dfd�Zd � Zd � Zd� Zd� Zd � ZdS )� N)� SysLogHandler)�breadcrumbs)� SentryHandler)�LveStatsSentryFilter�init_sentry_client)�debug�info�warning�error�critical�lvestatsc � � t j � t j � � t |� � t � � t t | |� � � � t | � � t j |� � S )z� Sets up logging :param dict|None config: pass None if config wasn't initialized yet, then don't use it. :param str caller_name: :param console_level: :param file_level: :return logging.Logger: log, initialized ) �logging�root�setLevel�DEBUG�init_console_log�init_syslog� init_file_log�get_file_logging_level�init_sentry_handler� getLogger)�config�caller_name� console_level� file_levels ��/builddir/build/BUILDROOT/lve-stats-4.2.10-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons/logsetup.py� setup_loggingr sk � � �L���'�-�(�(�(��]�#�#�#��M�M�M��(���<�<�=�=�=��������[�)�)�)� c �` � t ��t dt j �� � a t j � t � � t j d�� � } t � | � � t � t j � � d S d S # t $ r Y d S w xY w)Nz/dev/log)�address�facilityz1lve-stats: (%(name)s) [%(levelname)s] %(message)s��fmt)�SYS_LOGr � LOG_DAEMONr r � addHandler� Formatter�setFormatterr �ERROR� Exception)� formatter_syss r r r 3 s� � � ��?�#�J��AY�Z�Z�Z�G��L�#�#�G�,�,�,�#�-�2e�f�f�f�M�� � ��/�/�/����W�]�+�+�+�+�+� �?�� � � � ���� ���s �BB � B-�,B-c �L � d} t ��t j � |� � sSt j d� � }t |dd�� � 5 d d d � � n# 1 swxY w Y t j |� � t j |d� � t j |� � a t j � t � � t j d�� � }t � |� � t � | � � d S # t $ r Y d S w xY w) Nz/var/log/lve-stats.log�? �wzutf-8)�encodingi� z3%(asctime)s: (%(name)s) [%(levelname)s] %(message)sr# )�FILE_LOG�os�path�lexists�umask�open�chmodr �FileHandlerr r'