/usr/lib/python2.6/site-packages/oslo_i18n
Edit: /usr/lib/python2.6/site-packages/oslo_i18n/log.pyc (2873B)
Ņō
yDVc @ sC d Z d d k l Z d d k l Z d e i f d YZ d S( s" logging utilities for translation
i˙˙˙˙( t handlers( t
_translatet TranslationHandlerc B s8 e Z d Z d d d Z d Z d Z d Z RS( s 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.
c C s) t i i | d d d | | | _ d S( sŪ Initialize a TranslationHandler
:param locale: locale to use for translating messages
:param target: logging.Handler object to forward
LogRecord objects to after translation
t capacityi t targetN( R t
MemoryHandlert __init__t locale( t selfR R ( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR ; s c C s | i i | d S( N( R t setFormatter( R t fmt( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR J s c C s= | i } | i } z | i | Wd | | _ | | _ Xd S( N( t msgt argst _translate_and_log_record( R t recordt original_msgt
original_args( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyt emitM s c C sJ t i | i | i | _ t i | i | i | _ | i i | d S( N( R t translateR R t translate_argsR R R ( R R ( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR
Y s N( t __name__t
__module__t __doc__t NoneR R R R
( ( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR s
N( R t loggingR t oslo_i18nR R R ( ( ( s0 /tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyt
s