Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91942ae

Browse files
committed
[po] auto sync bot
1 parent 9dc1865 commit 91942ae

1 file changed

Lines changed: 25 additions & 19 deletions

File tree

howto/logging-cookbook.po

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# Meng Du <[email protected]>, 2019
1010
# MuSheng Chen <[email protected]>, 2019
1111
# 非法操作 <[email protected]>, 2019
12-
# Freesand Leo <[email protected]>, 2019
1312
# 浩听 王 <[email protected]>, 2019
13+
# Freesand Leo <[email protected]>, 2019
1414
#
1515
#, fuzzy
1616
msgid ""
@@ -19,7 +19,7 @@ msgstr ""
1919
"Report-Msgid-Bugs-To: \n"
2020
"POT-Creation-Date: 2019-09-01 14:24+0000\n"
2121
"PO-Revision-Date: 2017-02-16 17:45+0000\n"
22-
"Last-Translator: 浩听 王 <wht_andrew@163.com>, 2019\n"
22+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2019\n"
2323
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2424
"MIME-Version: 1.0\n"
2525
"Content-Type: text/plain; charset=UTF-8\n"
@@ -59,10 +59,10 @@ msgid ""
5959
"not configure) a child logger in a separate module, and all logger calls to "
6060
"the child will pass up to the parent. Here is a main module::"
6161
msgstr ""
62-
"多次调用``logging.getLogger('someLogger')``时会返回对同一个logger对象的引用。 "
63-
"这不仅是在同一个模块中,在其他模块调用也是如此,只要是在同一个Python解释器进程中。 "
64-
"是应该引用同一个对象,此外,应用程序也可以在一个模块中定义和配置父logger,而在单独的模块中创建(但不配置)子logger,对子logger的所有调用都将传给父logger。"
65-
" 这里是主模块::"
62+
"多次调用 ``logging.getLogger('someLogger')`` 时会返回对同一个 logger 对象的引用。 "
63+
"这不仅是在同一个模块中,在其他模块调用也是如此,只要是在同一个 Python 解释器进程中。 "
64+
"是应该引用同一个对象,此外,应用程序也可以在一个模块中定义和配置父 logger,而在单独的模块中创建(但不配置)子 logger,对子 logger "
65+
"的所有调用都将传给父 logger。 这里是主模块::"
6666

6767
#: ../../howto/logging-cookbook.rst:55
6868
msgid "Here is the auxiliary module::"
@@ -115,7 +115,7 @@ msgid ""
115115
"Notice that the 'application' code does not care about multiple handlers. "
116116
"All that changed was the addition and configuration of a new handler named "
117117
"*fh*."
118-
msgstr "需要注意的是,'应用程序' 代码并不关心是否有多个日志处理器。示例中所做的改变只是添加和配置了一个新的名为*fh*的日志处理器。"
118+
msgstr "需要注意的是,'应用程序' 代码并不关心是否有多个日志处理器。示例中所做的改变只是添加和配置了一个新的名为 *fh* 的日志处理器。"
119119

120120
#: ../../howto/logging-cookbook.rst:196
121121
msgid ""
@@ -271,9 +271,10 @@ msgid ""
271271
"of each message with the handler's level, and only passes a message to a "
272272
"handler if it's appropriate to do so."
273273
msgstr ""
274-
"在Python 3.5之前,:class:`QueueListener` "
275-
"总是把从队列中接收的每个消息都传给它初始化的日志处理程序。(这是因为它会假设过滤级别总是在队列的另一侧去设置的。) 从Python "
276-
"3.5开始,可以通过在监听器构造函数中添加一个参数``respect_handler_level=True``改变这种情况。当这样设置时,监听器会比较每条消息的等级和日志处理器中设置的等级,只把需要传递的消息传给对应的日志处理器。"
274+
"在 Python 3.5 之前,:class:`QueueListener` "
275+
"总是把从队列中接收的每个消息都传给它初始化的日志处理程序。(这是因为它会假设过滤级别总是在队列的另一侧去设置的。) 从 Python 3.5 "
276+
"开始,可以通过在监听器构造函数中添加一个参数 ``respect_handler_level=True`` "
277+
"改变这种情况。当这样设置时,监听器会比较每条消息的等级和日志处理器中设置的等级,只把需要传递的消息传给对应的日志处理器。"
277278

278279
#: ../../howto/logging-cookbook.rst:407
279280
msgid "Sending and receiving logging events across a network"
@@ -451,9 +452,10 @@ msgid ""
451452
" same format string can be used to get similar output to that shown above. "
452453
"Here's an example script::"
453454
msgstr ""
454-
"例如,在一个web应用程序中,正在处理的请求(或者至少是请求的一部分),可以存储在一个线程本地(:class:`threading.local`) "
455-
"变量中,然后从``Filter``中去访问。请求中的信息,如IP地址和用户名将被存储在``LogRecord``中,使用上例``LoggerAdapter``中的"
456-
" 'ip' 和 'user' 属性名。在这种情况下,可以使用相同的格式化字符串来得到上例中类似的输出结果。这是一段示例代码::"
455+
"例如,在一个web应用程序中,正在处理的请求(或者至少是请求的一部分),可以存储在一个线程本地 (:class:`threading.local`) "
456+
"变量中,然后从``Filter`` 中去访问。请求中的信息,如IP地址和用户名将被存储在``LogRecord``中,使用上例 "
457+
"``LoggerAdapter`` 中的 'ip' 和 'user' "
458+
"属性名。在这种情况下,可以使用相同的格式化字符串来得到上例中类似的输出结果。这是一段示例代码::"
457459

458460
#: ../../howto/logging-cookbook.rst:688
459461
msgid "which, when run, produces something like:"
@@ -594,7 +596,7 @@ msgstr ""
594596
msgid ""
595597
"Obviously this example sets the log length much too small as an extreme "
596598
"example. You would want to set *maxBytes* to an appropriate value."
597-
msgstr "显然,这个例子将日志长度设置得太小,这是一个极端的例子。 你可能希望将*maxBytes*设置为一个合适的值。"
599+
msgstr "显然,这个例子将日志长度设置得太小,这是一个极端的例子。 你可能希望将 *maxBytes* 设置为一个合适的值。"
598600

599601
#: ../../howto/logging-cookbook.rst:1047
600602
msgid "Use of alternative formatting styles"
@@ -1431,8 +1433,8 @@ msgid ""
14311433
"can use the :func:`~logging.config.dictConfig` API with an approach "
14321434
"illustrated by the following complete example::"
14331435
msgstr ""
1434-
"然后你可以在你的代码中使用``UTCFormatter``,而不是:class:`~logging.Formatter`.。 "
1435-
"如果你想通过配置来实现这一功能,你可以使用:func:`~logging.config.dictConfig` API "
1436+
"然后你可以在你的代码中使用 ``UTCFormatter``,而不是 :class:`~logging.Formatter`。 "
1437+
"如果你想通过配置来实现这一功能,你可以使用 :func:`~logging.config.dictConfig` API "
14361438
"来完成,该方法在以下完整示例中展示::"
14371439

14381440
#: ../../howto/logging-cookbook.rst:2469
@@ -1491,7 +1493,11 @@ msgid ""
14911493
"#6 appears (like message #1) whereas message #7 doesn't (just like message "
14921494
"#2)."
14931495
msgstr ""
1494-
"我们最初设置日志记录器的消息等级为``INFO``,因此消息#1出现,消息#2没有出现。在接下来的`with``代码块中我们暂时将消息等级变更为``DEBUG``,从而消息#3出现。在这一代码块退出后,日志记录器的消息等级恢复为``INFO``,从而消息#4没有出现。在下一个``with``代码块中,我们再一次将设置消息等级设置为``DEBUG``,同时添加一个将消息写入``sys.stdout``的日志处理器。因此,消息#5在控制台出现两次(分别通过``stderr``和``stdout``)。在``with``语句完成后,状态与之前一样,因此消息#6出现(类似消息#1),而消息#7没有出现(类似消息#2)。"
1496+
"我们最初设置日志记录器的消息等级为 ``INFO``,因此消息#1出现,消息#2没有出现。在接下来的 ``with``代码块中我们暂时将消息等级变更为 "
1497+
"``DEBUG``,从而消息 #3 出现。在这一代码块退出后,日志记录器的消息等级恢复为 ``INFO``,从而消息 #4 没有出现。在下一个 "
1498+
"``with`` 代码块中,我们再一次将设置消息等级设置为 ``DEBUG``,同时添加一个将消息写入 ``sys.stdout`` "
1499+
"的日志处理器。因此,消息#5在控制台出现两次 (分别通过 ``stderr`` 和 ``stdout``)。在 ``with`` "
1500+
"语句完成后,状态与之前一样,因此消息 #6 出现(类似消息 #1),而消息 #7 没有出现(类似消息 #2)。"
14951501

14961502
#: ../../howto/logging-cookbook.rst:2552
14971503
msgid "If we run the resulting script, the result is as follows:"
@@ -1506,13 +1512,13 @@ msgstr ""
15061512

15071513
#: ../../howto/logging-cookbook.rst:2571
15081514
msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:"
1509-
msgstr "再一次,将``stdout``标准输出重定向到``/dev/null``,我获得如下结果:"
1515+
msgstr "再一次,将 ``stdout`` 标准输出重定向到 ``/dev/null``,我获得如下结果:"
15101516

15111517
#: ../../howto/logging-cookbook.rst:2581
15121518
msgid ""
15131519
"In this case, the message #5 printed to ``stdout`` doesn't appear, as "
15141520
"expected."
1515-
msgstr "在这种情况下,与预期一致,打印到``stdout``标准输出的消息#5不会出现。"
1521+
msgstr "在这种情况下,与预期一致,打印到 ``stdout`` 标准输出的消息#5不会出现。"
15161522

15171523
#: ../../howto/logging-cookbook.rst:2583
15181524
msgid ""

0 commit comments

Comments
 (0)