11111212# Shengjing Zhu <[email protected] >, 20191313# Meng Du <[email protected] >, 202014- # Freesand Leo <[email protected] >, 20201514# Dai Xu <[email protected] >, 202115+ # Freesand Leo <[email protected] >, 20211616#
1717#, fuzzy
1818msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121"Report-Msgid-Bugs-To : \n "
2222"POT-Creation-Date : 2021-01-01 05:02+0000\n "
2323"PO-Revision-Date : 2017-02-16 17:45+0000\n "
24- "Last-Translator : Dai Xu <daixu61@hotmail .com>, 2021\n "
24+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2626"MIME-Version : 1.0\n "
2727"Content-Type : text/plain; charset=UTF-8\n "
@@ -337,13 +337,15 @@ msgid ""
337337"logging an application, it could be hard to manage if the number of "
338338":class:`Logger` instances becomes effectively unbounded."
339339msgstr ""
340- "有时,除了传递给日志记录器调用的参数外,我们还希望日志记录中包含上下文信息。例如,有一个网络应用,可能需要记录一些特殊的客户端信息在日志中(比如客户端的用户名、IP地址等)。虽然你可以通过设置额外的参数去达到这个目的,但这种方式不一定方便。或者你可能想到在每个连接的基础上创建一个"
341- " :class:`Logger` 的实例,但这些实例是不会被垃圾回收的,这在练习中也许不是问题,但当 :class:`Logger` "
342- "的实例数量取决于你应用程序中想记录的细致程度时,如果 :class:`Logger` 的实例数量不受限制的话,将会变得难以管理。"
340+ "有时,除了调用日志对象时传入的参数之外,还希望日志输出中能包含上下文信息。 "
341+ "比如在网络应用程序中,可能需要在日志中记录某客户端专属的信息(如远程客户端的用户名或 IP 地址)。 这虽然可以用 *extra* "
342+ "参数实现,但传递起来并不总是很方便。 虽然为每个网络连接都创建 :class:`Logger` "
343+ "实例貌似不错,但并不是个好主意,因为这些实例不会被垃圾回收。 虽然在实践中不是问题,但当 :class:`Logger` "
344+ "实例的数量取决于应用程序要采用的日志粒度时,如果 :class:`Logger` 实例的数量实际上是无限的,则有可能难以管理。 "
343345
344346#: ../../howto/logging-cookbook.rst:564
345347msgid "Using LoggerAdapters to impart contextual information"
346- msgstr "使用日志适配器传递上下文信息 "
348+ msgstr "利用 LoggerAdapter 传递上下文信息 "
347349
348350#: ../../howto/logging-cookbook.rst:566
349351msgid ""
@@ -355,10 +357,10 @@ msgid ""
355357"same signatures as their counterparts in :class:`Logger`, so you can use the"
356358" two types of instances interchangeably."
357359msgstr ""
358- "一个传递上下文信息和日志事件信息的简单办法是使用类 :class:`LoggerAdapter`。 这个类设计的像 "
360+ "要传递上下文信息和日志事件信息,有一种简单方案是利用 :class:`LoggerAdapter` 类。这个类设计得类似 "
359361":class:`Logger`,所以可以直接调用 :meth:`debug`、:meth:`info`、 :meth:`warning`、 "
360- ":meth:`error`、:meth:`exception`、 :meth:`critical` 和 :meth:`log`。 这些方法在对应的 "
361- ":class:`Logger` 中使用相同的签名,所以可以交替使用两种类型的实例 。"
362+ ":meth:`error`、:meth:`exception`、 :meth:`critical` 和 :meth:`log`。这些方法的签名与 "
363+ ":class:`Logger` 对应的方法相同,所以这两类实例可以交换使用 。"
362364
363365#: ../../howto/logging-cookbook.rst:574
364366msgid ""
0 commit comments