@@ -733,7 +733,7 @@ msgstr "只要愿意,上述类似的效果即可用 :class:`LoggerAdapter` 实
733733msgid ""
734734"The above script should log the message ``Hello, world!`` when run with "
735735"Python 3.2 or later."
736- msgstr ""
736+ msgstr "在用 Python 3.2 以上版本运行时,上述代码应该会把 ``Hello, world!`` 写入日志。 "
737737
738738#: ../../howto/logging-cookbook.rst:1216
739739msgid "Customizing ``LogRecord``"
@@ -749,12 +749,16 @@ msgid ""
749749"disabled). Before Python 3.2, there were only two places where this creation"
750750" was done:"
751751msgstr ""
752+ "每条日志事件都由一个 :class:`LogRecord` 实例表示。当某事件要记入日志并且没有被某级别过滤掉时,就会创建一个 "
753+ ":class:`LogRecord` 对象,并将有关事件的信息填入,传给该日志对象的 handler(及其祖先,直至对象禁止向上传播为止)。在 "
754+ "Python 3.2 之前,只有两个地方会进行事件的创建:"
752755
753756#: ../../howto/logging-cookbook.rst:1225
754757msgid ""
755758":meth:`Logger.makeRecord`, which is called in the normal process of logging "
756759"an event. This invoked :class:`LogRecord` directly to create an instance."
757760msgstr ""
761+ ":meth:`Logger.makeRecord`,在事件正常记入日志的过程中调用。这会直接调用 :class:`LogRecord` 来创建一个实例。"
758762
759763#: ../../howto/logging-cookbook.rst:1228
760764msgid ""
@@ -764,19 +768,24 @@ msgid ""
764768"via a :class:`~handlers.SocketHandler`, or in JSON form via an "
765769":class:`~handlers.HTTPHandler`)."
766770msgstr ""
771+ ":func:`makeLogRecord`,调用时会带上一个字典参数,其中存放着要加入 LogRecord "
772+ "的属性。这通常在通过网络接收到合适的字典时调用(如通过 :class:`~handlers.SocketHandler` 以 pickle 形式,或通过"
773+ " :class:`~handlers.HTTPHandler` 以 JSON 形式)。"
767774
768775#: ../../howto/logging-cookbook.rst:1234
769776msgid ""
770777"This has usually meant that if you need to do anything special with a "
771778":class:`LogRecord`, you've had to do one of the following."
772- msgstr ""
779+ msgstr "于是这意味着若要对 :class:`LogRecord` 进行定制,必须进行下述某种操作。 "
773780
774781#: ../../howto/logging-cookbook.rst:1237
775782msgid ""
776783"Create your own :class:`Logger` subclass, which overrides "
777784":meth:`Logger.makeRecord`, and set it using :func:`~logging.setLoggerClass` "
778785"before any loggers that you care about are instantiated."
779786msgstr ""
787+ "创建 :class:`Logger` 自定义子类,重写 :meth:`Logger.makeRecord`,并在实例化所需日志对象之前用 "
788+ ":func:`~logging.setLoggerClass` 进行设置。"
780789
781790#: ../../howto/logging-cookbook.rst:1240
782791msgid ""
0 commit comments