Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/oslo_i18n/__pycache__/log.cpython-39.pyc
Ðазад
a n�h� � @ s2 d Z ddlmZ ddlmZ G dd� dej�ZdS )z"logging utilities for translation � )�handlers)� _translatec @ s2 e Zd ZdZddd�Zdd� Zdd� Zd d � ZdS )�TranslationHandlera Handler that translates records before logging them. When lazy translation is enabled in the application (see :func:`~oslo_i18n.enable_lazy`), the :class:`TranslationHandler` uses its locale configuration setting to determine how to translate LogRecord objects before forwarding them to the logging.Handler. When lazy translation is disabled, the message in the LogRecord is converted to unicode without any changes and then forwarded to the logging.Handler. The handler can be configured declaratively in the ``logging.conf`` as follows:: [handlers] keys = translatedlog, translator [handler_translatedlog] class = handlers.WatchedFileHandler args = ('/var/log/api-localized.log',) formatter = context [handler_translator] class = oslo_i18n.log.TranslationHandler target = translatedlog args = ('zh_CN',) If the specified locale is not available in the system, the handler will log in the default locale. Nc C s t jj| d|d� || _dS )z�Initialize a TranslationHandler :param locale: locale to use for translating messages :param target: logging.Handler object to forward LogRecord objects to after translation r )�capacity�targetN)r � MemoryHandler�__init__�locale)�selfr r � r �}/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/oslo_i18n/log.pyr ; s zTranslationHandler.__init__c C s | j �|� d S �N)r �setFormatter)r �fmtr r r r J s zTranslationHandler.setFormatterc C s: |j }|j}z| �|� W ||_ ||_n||_ ||_0 d S r )�msg�args�_translate_and_log_record)r �recordZoriginal_msgZ original_argsr r r �emitM s �zTranslationHandler.emitc C s4 t �|j| j�|_t �|j| j�|_| j�|� d S r )r � translater r Ztranslate_argsr r r )r r r r r r Y s z,TranslationHandler._translate_and_log_record)NN)�__name__� __module__�__qualname__�__doc__r r r r r r r r r s ! r N)r �loggingr Z oslo_i18nr r r r r r r �<module> s
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка