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

Skip to content

Commit db96624

Browse files
committed
[po] auto sync bot
1 parent 9f477ce commit db96624

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

howto/logging-cookbook.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# 欢 王 <[email protected]>, 2018
99
# Meng Du <[email protected]>, 2019
1010
# MuSheng Chen <[email protected]>, 2019
11-
# 非法操作 <[email protected]>, 2019
1211
# Freesand Leo <[email protected]>, 2019
12+
# 非法操作 <[email protected]>, 2019
1313
#
1414
#, fuzzy
1515
msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818
"Report-Msgid-Bugs-To: \n"
1919
"POT-Creation-Date: 2019-01-01 10:14+0900\n"
2020
"PO-Revision-Date: 2017-02-16 17:45+0000\n"
21-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2019\n"
21+
"Last-Translator: 非法操作 <ultrahe@gmail.com>, 2019\n"
2222
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2323
"MIME-Version: 1.0\n"
2424
"Content-Type: text/plain; charset=UTF-8\n"
@@ -450,14 +450,17 @@ msgid ""
450450
" same format string can be used to get similar output to that shown above. "
451451
"Here's an example script::"
452452
msgstr ""
453+
"例如,在一个web应用程序中,正在处理的请求(或者至少是请求的一部分),可以存储在一个线程本地(:class:`threading.local`) "
454+
"变量中,然后从``Filter``中去访问。请求中的信息,如IP地址和用户名将被存储在``LogRecord``中,使用上例``LoggerAdapter``中的"
455+
" 'ip' 和 'user' 属性名。在这种情况下,可以使用相同的格式化字符串来得到上例中类似的输出结果。这是一段示例代码::"
453456

454457
#: ../../howto/logging-cookbook.rst:688
455458
msgid "which, when run, produces something like:"
456-
msgstr ""
459+
msgstr "在运行时,产生如下内容:"
457460

458461
#: ../../howto/logging-cookbook.rst:709
459462
msgid "Logging to a single file from multiple processes"
460-
msgstr ""
463+
msgstr "从多个进程记录至单个文件"
461464

462465
#: ../../howto/logging-cookbook.rst:711
463466
msgid ""
@@ -474,6 +477,8 @@ msgid ""
474477
" and includes a working socket receiver which can be used as a starting "
475478
"point for you to adapt in your own applications."
476479
msgstr ""
480+
"尽管logging是线程安全的,将单个进程中的多个线程日志记录至单个文件也是支持的,但通过多个进程记录至单个文件却是不支持的,因为在Python中没有标准的方案在多个进程中去序列化数据至一个文件。如果你需要将多个进程记录至单个文件,有一个方案是让所有的进程都记录日志至:class:`~handlers.SocketHandler`,然后用一个单独的实现了套接字服务器的进程一边从套接字中读取一遍记录至日志文件。(如果你愿意,也可以在一个现有进程的单独线程中执行此工作)文档:ref:`This"
481+
" section 1`中有更详细的介绍并包括一个可以运行的套接字接收器,可以作为基础去适配你自己的程序。"
477482

478483
#: ../../howto/logging-cookbook.rst:724
479484
msgid ""
@@ -486,6 +491,9 @@ msgid ""
486491
":mod:`multiprocessing` module does not provide working lock functionality on"
487492
" all platforms (see https://bugs.python.org/issue3770)."
488493
msgstr ""
494+
"如果你使用的是最近一些版本的Python包含了:mod:`multiprocessing`模块的,你也可以使用:class:`~multiprocessing.Lock`写自己的处理程序让其从多个进程中按顺序记录至文件。现有的"
495+
" :class:`FileHandler` 和它的子类目前没有使用:mod:`multiprocessing` "
496+
",尽管将来可能会这样做。请注意目前:mod:`multiprocessing`模块并非在所有平台上提供锁的功能(查阅https://bugs.python.org/issue3770)。"
489497

490498
#: ../../howto/logging-cookbook.rst:735
491499
msgid ""

0 commit comments

Comments
 (0)