Ky\w6t 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 dZdadadadade j dfdZd Zd Zd Zd Zd ZdS ) N) SysLogHandler)breadcrumbs) SentryHandler)LveStatsSentryFilterinit_sentry_client)debuginfowarningerrorcriticallvestatsc 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 ) loggingrootsetLevelDEBUGinit_console_loginit_syslog init_file_logget_file_logging_levelinit_sentry_handler getLogger)configcaller_name console_level file_levels /builddir/build/BUILDROOT/lve-stats-4.3.2-1.el9.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons/logsetup.py setup_loggingr sk L'-(((]###MMM(<<===[))) 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)addressfacilityz1lve-stats: (%(name)s) [%(levelname)s] %(message)sfmt)SYS_LOGr LOG_DAEMONr r addHandler FormattersetFormatterr ERROR Exception) formatter_syss r r r 3 s ?#JAYZZZGL##G,,,#-2efffM ///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_LOGospathlexistsumaskopenchmodr FileHandlerr r' r( r) r r+ )r log_file_nameumask_saved formatters r r r @ sN ,M 7??=11 & htnn-w??? %%%H]E****=99HL##H---).cdddI!!),,,*%%%%% s7 AD AD A""D %A"&B-D D#"D#c t dD ]"}t j |t j #t }t | a t }t | |j | t j t t t j t rg| rgdt j j vrV| dd t j j d<